Quote:
Originally posted by Link14716
With your new code, I get this error:
Code:
Fatal error: Call to undefined function: get_defined_functions() in /home/sites/site68/web/forums/admin/functions.php on line 854
|
ok, try changing your doif function to this, it wont remove the functions but it will remove the ( ) from the code instead and that should disable any functions in the code.
PHP Code:
// ###################### Do IF #######################
function doif($code,$text,$output=0) {
extract ($GLOBALS);
//Editable Options Below
$admin_only = false; //Set to true if you want only admins to use this.
$admin_view_all = false; //Set to true if you want to allow admins to view all text.
//Editable Options Above
$postadmin = false;
if ($post['usergroupid']==6 or $postinfo['usergroupid']==6) $postadmin = true;
$isadmin = false;
if ($bbuserinfo['usergroupid']==6) $isadmin = true;
if ($code and (!$admin_only or $admin_only and $postadmin)) {
unset($codestuff);
while (list($key,$val)=each($bbuserinfo)) {
$codestuff .= '$bb'.strtolower($key).' = "'.$val.'";';
@define("bb".strtolower($key),$val,true);
}
@eval($codestuff);
$code = str_replace("(","",$code);
$code = str_replace(")","",$code);
@eval ('if ('.stripslashes($code).') { $eval_code= "1"; } else { $eval_code= "0"; }');
if ($eval_code or $bbuserinfo['userid'] == ($post['userid'] or $postinfo['userid']) or ($isadmin and $admin_view_all)) {
if (!$output) {
return "<table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>Private Text: ".iif($isadmin,"(".stripslashes($code).")","")."</b></smallfont></td></tr><tr><td class=\"privatetext_style\">".bbcodeparse($text)."</td></tr></table>";
} else return "[if(".stripslashes($code).")]".$text."[/if]";
} else {
return "";
}
}
if ($admin_only and !$postadmin) return "[if(".stripslashes($code).")]".$text."[/if]";
else return bbcodeparse($text);
}