Пример #1
0
    list($color, $description) = $details;
    echo '<tr><th>' . $function . '</th><th colspan="2" bgcolor="';
    if (function_exists(strtolower($function))) {
        echo 'lime">TRUE';
    } else {
        echo $color . '">FALSE';
    }
    echo '</th><td>' . $description . '</td></tr>';
}
echo '<tr bgcolor="#EEEEEE"><th colspan="4">&nbsp;</th></tr>';
echo '<tr bgcolor="#EEEEEE"><th>Setting</th><th>Master Value</th><th>Local Value</th><th>Comments</th></tr>';
$SettingFeatures = array('magic_quotes_runtime' => array('red', 'lime', 'This setting is evil. Turn it off.'), 'magic_quotes_gpc' => array('yellow', 'lime', 'This setting is bad. Turn it off, if possible. phpThumb will attempt to work around it if it is enabled.'), 'safe_mode' => array('orange', 'lime', 'Best if off. Calls to ImageMagick will be disabled if safe_mode is set to prevent writing temp files (limiting max image resolution, no animated GIF resize). Raw image data sources (e.g. from MySQL database) may not work. Temp files may be disabled. Features will be limited. If disabled in Master but enabled in Local, edit httpd.conf and set (php_admin_value safe_mode "Off") between <VirtualHost> tags'), 'allow_url_fopen' => array('lime', 'yellow', 'Best if on. HTTP source images will be unavailable if disabled and CURL is unavailable.'));
foreach ($SettingFeatures as $feature => $FeaturesDetails) {
    list($color_true, $color_false, $reason) = $FeaturesDetails;
    echo '<tr><th>' . $feature . ':</th>';
    echo '<th bgcolor="' . (@get_cfg_var($feature) ? $color_true : $color_false) . '">' . $phpThumb->phpThumbDebugVarDump((bool) @get_cfg_var($feature)) . '</th>';
    echo '<th bgcolor="' . (@ini_get($feature) ? $color_true : $color_false) . '">' . $phpThumb->phpThumbDebugVarDump((bool) @ini_get($feature)) . '</th>';
    echo '<td>' . htmlentities($reason) . '</td></tr>';
}
$MissingFunctionSeverity = array('shell_exec' => 'red', 'system' => 'red', 'passthru' => 'red', 'exec' => 'red', 'curl_exec' => 'orange');
$DisabledFunctions[0] = explode(',', @get_cfg_var('disable_functions'));
$DisabledFunctions[1] = explode(',', @ini_get('disable_functions'));
echo '<tr><th>disable_functions:</th>';
for ($i = 0; $i <= 1; $i++) {
    //echo '<th bgcolor="'.(count($DisabledFunctions[$i]) ? 'yellow' : 'lime').'">';
    echo '<th>';
    $disabled_functions = '';
    foreach ($DisabledFunctions[$i] as $key => $value) {
        if (@$MissingFunctionSeverity[$value]) {
            $DisabledFunctions[$i][$key] = '<span style="background-color: ' . $MissingFunctionSeverity[$value] . ';">' . $value . '</span>';
        }
Пример #2
0
        } else {
            $phpThumb->ErrorImage('ERROR: "' . $SourceFilename . '" cannot be read');
        }
    }
    if (@$_SERVER['HTTP_REFERER']) {
        $phpThumb->ErrorImage('&md5s=' . $md5s);
    } else {
        die('&md5s=' . $md5s);
    }
}
if (!empty($PHPTHUMB_CONFIG)) {
    foreach ($PHPTHUMB_CONFIG as $key => $value) {
        $keyname = 'config_' . $key;
        $phpThumb->setParameter($keyname, $value);
        if (!preg_match('/password/i', $key)) {
            $phpThumb->DebugMessage('setParameter(' . $keyname . ', ' . $phpThumb->phpThumbDebugVarDump($value) . ')', __FILE__, __LINE__);
        }
    }
} else {
    $phpThumb->DebugMessage('$PHPTHUMB_CONFIG is empty', __FILE__, __LINE__);
}
if (@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && preg_match('/^http\\:\\/\\/' . @$_SERVER['HTTP_HOST'] . '(.+)/i', @$_GET['src'], $matches)) {
    $phpThumb->ErrorImage('It is MUCH better to specify the "src" parameter as "' . $matches[1] . '" instead of "' . $matches[0] . '".' . "\n\n" . 'If you really must do it this way, enable "allow_local_http_src" in phpThumb.config.php');
}
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[1]', __FILE__, __LINE__);
if (@$_GET['phpThumbDebug'] == '1') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
    list($color, $description) = $details;
    echo '<tr><th>' . $function . '</th><th colspan="2" style="background-color: ';
    if (function_exists(strtolower($function))) {
        echo 'lime;">TRUE';
    } else {
        echo $color . ';">FALSE';
    }
    echo '</th><td>' . htmlentities($description) . '</td></tr>';
}
echo '<tr style="background-color: #EEEEEE;"><th colspan="4">&nbsp;</th></tr>';
echo '<tr style="background-color: #EEEEEE;"><th>Setting</th><th>Master Value</th><th>Local Value</th><th>Comments</th></tr>';
$SettingFeatures = array('magic_quotes_runtime' => array('red', 'lime', 'This setting is evil. Turn it off.'), 'magic_quotes_gpc' => array('yellow', 'lime', 'This setting is bad. Turn it off, if possible. phpThumb will attempt to work around it if it is enabled.'), 'safe_mode' => array('orange', 'lime', 'Best if off. Calls to ImageMagick will be disabled if safe_mode is set to prevent writing temp files (limiting max image resolution, no animated GIF resize). Raw image data sources (e.g. from MySQL database) may not work. Temp files may be disabled. Features will be limited. If disabled in Master but enabled in Local, edit httpd.conf and set (php_admin_value safe_mode "Off") between <VirtualHost> tags'), 'allow_url_fopen' => array('lime', 'yellow', 'Best if on. HTTP source images will be unavailable if disabled and CURL is unavailable.'));
foreach ($SettingFeatures as $feature => $FeaturesDetails) {
    list($color_true, $color_false, $reason) = $FeaturesDetails;
    echo '<tr><th>' . $feature . ':</th>';
    echo '<th style="background-color: ' . (@get_cfg_var($feature) ? $color_true : $color_false) . ';">' . $phpThumb->phpThumbDebugVarDump((bool) @get_cfg_var($feature)) . '</th>';
    echo '<th style="background-color: ' . (preg_match('#(1|ON)#i', @ini_get($feature)) ? $color_true : $color_false) . ';">' . $phpThumb->phpThumbDebugVarDump((bool) preg_match('#(1|ON)#i', ini_get($feature))) . '</th>';
    echo '<td>' . htmlentities($reason) . '</td></tr>';
}
$MissingFunctionSeverity = array('shell_exec' => 'red', 'system' => 'red', 'passthru' => 'red', 'exec' => 'red', 'curl_exec' => 'orange');
$DisabledFunctions[0] = explode(',', @get_cfg_var('disable_functions'));
$DisabledFunctions[1] = explode(',', @ini_get('disable_functions'));
echo '<tr><th>disable_functions:</th>';
for ($i = 0; $i <= 1; $i++) {
    foreach ($DisabledFunctions[$i] as $key => $value) {
        if (!empty($MissingFunctionSeverity[$value])) {
            $DisabledFunctions[$i][$key] = '<span style="background-color: ' . $MissingFunctionSeverity[$value] . ';">' . $value . '</span>';
        }
    }
    $disabled_functions = implode(', ', $DisabledFunctions[$i]);
    echo '<th style="background-color: ' . ($disabled_functions ? 'yellow' : 'lime') . ';">';