Пример #1
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);
        }
    }
}
Пример #2
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);
        }
    }
}
function php_ini_check($name, $args)
{
    global $passed_icon, $error_icon, $warning_icon, $is_windows;
    $safe_mode = ini_get('safe_mode');
    $ini_value = ini_get($name);
    $check = isset($args['check']) ? $args['check'] : '=';
    $verbose_value = isset($args['verbose_value']) ? $args['verbose_value'] : $args['value'];
    $ini_value_verbose = '';
    if ($verbose_value == 'On' || $verbose_value == 'Off') {
        $ini_value_verbose = ' = ' . ($ini_value ? 'On' : 'Off');
    }
    switch ($check) {
        case 'not set':
            $check = lang('not set');
            $result = !($ini_value & $args['value']);
            break;
        case 'set':
            $check = lang('set');
            $result = !!($ini_value & $args['value']);
            break;
        case '>=':
            $result = !$ini_value || (int) mk_value($ini_value) >= (int) mk_value($args['value']);
            break;
        case 'contain':
            $check = lang('contain');
            $sep = $is_windows ? '[; ]+' : '[: ]+';
            $result = in_array($args['value'], split($sep, $ini_value));
            break;
        case '=':
        default:
            $result = $ini_value == $args['value'];
            break;
    }
    $msg = ' ' . lang('Checking php.ini') . ": {$name} {$check} {$verbose_value}: <div id='setup_info'>ini_get('{$name}')='{$ini_value}'{$ini_value_verbose}</div>\n";
    if ($result) {
        echo $passed_icon . $msg;
    }
    if (!$result) {
        if (isset($args['warning'])) {
            echo $warning_icon . $msg . $args['warning'] . "<br/></span>\n";
        }
        if (isset($args['error'])) {
            echo $error_icon . $msg . $args['error'] . "</br></span>\n";
        }
        if (isset($args['safe_mode']) && $safe_mode || @$args['change']) {
            if (!isset($args['warning']) && !isset($args['error'])) {
                echo $error_icon . $msg . "<br/></span>";
            }
            echo "<div id='setup_error'>\n";
            echo '*** ' . lang('Please make the following change in your php.ini') . ' (' . get_php_ini() . '): ' . (@$args['safe_mode'] ? $args['safe_mode'] : $args['change']) . "<br>\n";
            echo '*** ' . lang('AND reload your webserver, so the above changes take effect !!!') . "</div>\n";
        }
    }
    return $result;
}