From: Jason Woofenden Date: Wed, 6 May 2009 18:17:19 +0000 (-0400) Subject: run.php sets GLOBALS[basename] and handles 404 better X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=de71c4c4768f8f464ff61cfda3f8e31d20d2b0b0;p=wfpl.git run.php sets GLOBALS[basename] and handles 404 better --- diff --git a/run.php b/run.php index 09b51b5..bbf2ce6 100644 --- a/run.php +++ b/run.php @@ -78,6 +78,8 @@ function run_php($dest = false) { } } + $GLOBALS['basename'] = $basename; + $html_file = "$basename.html"; $php_file = "$basename.php"; @@ -112,11 +114,13 @@ function run_php($dest = false) { if(!$php_exists && !$html_exists && !$cms_content) { header('HTTP/1.0 404 File Not Found'); - if(file_exists('404.php') || file_exists('404.html')) { - run_php('404'); + if(file_exists('error_404.php') || file_exists('error_404.html')) { + $GLOBALS['error_basename'] = $basename; + run_php('error_404'); return; } else { echo '404

404 File Not Found

'; + exit(); } }