JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
run.php sets GLOBALS[basename] and handles 404 better
authorJason Woofenden <jason283@herkamire.com>
Wed, 6 May 2009 18:17:19 +0000 (14:17 -0400)
committerJason Woofenden <jason283@herkamire.com>
Wed, 6 May 2009 18:17:19 +0000 (14:17 -0400)
run.php

diff --git a/run.php b/run.php
index 09b51b5..bbf2ce6 100644 (file)
--- 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 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>404</title></head><body><h1>404 File Not Found</h1></body></html>';
+                       exit();
                }
        }