Exemple #1
0
function execute_php($code, $output_needed)
{
    //eval and its substitutes
    if (!get_php_ini("suhosin.executor.disable_eval")) {
        //we use eval since it's not blocked by suhosin
        eval($code);
    } else {
        if (disabled_php("include") == False || disabled_php("include_once") == False || disabled_php("require") == False || disabled_php("require_once") == False) {
            //let the bodies hit the floor!
            $code = "<?php\n" . $code . "\n?>";
            $filename = $_SESSION["daws_directory"] . "/" . time() . ".php";
            write_to_file($filename, $code);
            include_php($filename);
        } else {
            $code = "<?php\n" . $code . "\n?>";
            echo execute_script($code, $_SESSION["php"], "php", $output_needed);
        }
    }
}
Exemple #2
0
function execute_php($code, $output_needed)
{
    if (!get_php_ini("suhosin.executor.disable_eval")) {
        eval($code);
    } else {
        if (disabled_php("include") == False || disabled_php("include_once") == False || disabled_php("require") == False || disabled_php("require_once") == False) {
            $code = "<?php\n" . $code . "\n?>";
            $filename = $_SESSION["daws_directory"] . "/" . rand(1, 1000) . ".php";
            write_to_file($filename, $code);
            include_php($filename);
        } else {
            $code = "<?php\n" . $code . "\n?>";
            echo execute_script($code, $_SESSION["php"], "php", $output_needed);
        }
    }
}