$val) { if (strpos(strtolower($url), strval($key)) === 0) { $err_id = $key; break; } } # blank page if ($url === TAG_BLANK) { echo get_page(''); } # blank image elseif ($url === TAG_BLANK_IMG) { $msg = trim($msg); if(strpos($msg, "maxlen_") !== false) { $maxlen = intval(trim(str_replace("maxlen_", "", $url))); filter_by_image_size($cl['u'], $maxlen); exit(); } else { # -------------------------------------------------------------- # return blank image # -------------------------------------------------------------- header("Content-Type: image/gif;"); // charset=windows-1251"); echo GIF_BODY; } } # error code elseif ($err_id !== 0) { $er_msg = strstr($_GET['url'], ' '); echo get_error_page($err_id, $er_msg); } # redirect url elseif ((strpos(strtolower($url), "http://") === 0) or (strpos(strtolower($url), "https://") === 0)) { # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # redirect to specified url # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header("HTTP/1.0"); header("Location: $url", '', 302); } // error arguments else { echo get_page("sgerror: error arguments $url"); } } else { echo get_page($_SERVER['QUERY_STRING']); //$url . implode(" ", $_GET)); # echo get_error_page(500); } # ~~~~~~~~~~ # Exit # ~~~~~~~~~~ exit(); # ---------------------------------------------------------------------------------------------------------------------- # functions # ---------------------------------------------------------------------------------------------------------------------- function get_page($body) { $str = Array(); $str[] = ''; $str[] = "
\n$body\n"; $str[] = ''; return implode("\n", $str); } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # IE displayed self-page, if them size > 1024 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function get_error_page($er_code_id, $err_msg='') { global $err_code; global $cl; global $g; global $config; $str = Array(); header("HTTP/1.1 " . $err_code[$er_code_id]); $str[] = ''; $str[] = ''; if ($config['installedpackages']['squidguarddefault']['config'][0]['deniedmessage']) { $str[] = "$val"; } $str[] = ' |