<?php
function safeEval($arg,$badwords)
{
//if(stripos($arg,$badwords) !== false)
$arg = explode("''",$arg);
$bardwords = array();
if(in_array($badwords,$arg)
{
str_ireplace($badwords,"''",$arg)
//echo "it has been found";
return;
}
else
return eval($arg);
}
$string = "echo 'Hello drop Kyle';";
$find = array("update","drop");
safeEval($string,$find);
- Output for 5.3.0 - 5.3.25, 5.4.0 - 5.4.15
- Parse error: syntax error, unexpected '{' in /in/A5kqG on line 8
Process exited with code 255.
preferences:
187.97 ms | 1395 KiB | 49 Q