From de71c4c4768f8f464ff61cfda3f8e31d20d2b0b0 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Wed, 6 May 2009 14:17:19 -0400 Subject: [PATCH] run.php sets GLOBALS[basename] and handles 404 better --- run.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); } } -- 1.7.10.4