function index_404error() { global $smarty, $lang; @utils_status_header(404); $module = 'default.tpl'; $smarty->assign('subject', $lang['404error']['subject']); $smarty->assign('content', $lang['404error']['content']); $smarty->assign('rawcontent', true); return $module; }
function wp_redirect($location, $status = 302) { global $is_IIS; $location = apply_filters('wp_redirect', $location, $status); if (!$location) { // allows the wp_redirect filter to cancel a redirect return false; } $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location); # $location = wp_kses_no_null($location); $location = preg_replace('/\\0+/', '', $location); $location = preg_replace('/(\\\\0)+/', '', $location); $strip = array('%0d', '%0a'); $location = str_replace($strip, '', $location); if ($is_IIS) { header("Refresh: 0;url={$location}"); } else { if (php_sapi_name() != 'cgi-fcgi') { utils_status_header($status); } // This causes problems on IIS and some FastCGI setups header("Location: {$location}"); } }
<?php // Example of use require_once 'defaults.php'; require_once INCLUDES_DIR . 'includes.php'; /* backward compatibility */ if (!@$_GET['entry']) { @utils_redirect('?' . $_SERVER['QUERY_STRING']); } else { @utils_status_header(301); @utils_redirect(str_replace('&', '&', get_permalink($_GET['entry'])), true); }