diff --git a/index.php b/index.php index 4b21bc0..0077caf 100644 --- a/index.php +++ b/index.php @@ -33,12 +33,12 @@ error_reporting(E_ALL | E_STRICT); $debugOutput = ''; if (isset($_POST['code'])) { - $code = $_POST['code']; - if (get_magic_quotes_gpc()) { $code = stripslashes($code); } + $code = trim(preg_replace('{^\s*<\?(php)?}i', '', $_POST['code'])); + // if there's only one line wrap it into a krumo() call if (preg_match('#^(?!var_dump|echo|print|< )([^\r\n]+?);?\s*$#is', $code, $m) && trim($m[1])) { $code = 'krumo('.$m[1].');'; @@ -88,7 +88,7 @@ if (isset($_POST['code'])) {