X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=main.php;h=eae4de9471deded93ef3954bb77e5267b7da9c9b;hb=63853e1feaf55ab5542f06de4e914af24e8cc3e3;hp=e088d67218753c5aa0b3836a4d805cff0dae38bb;hpb=23dfbcc20fc6d20fb5be211e5af50cdcb8565c8e;p=wfpl.git diff --git a/main.php b/main.php index e088d67..eae4de9 100644 --- a/main.php +++ b/main.php @@ -40,7 +40,7 @@ function wfpl_main($dest = false) { # if it starts with './' then it's a relative URL, redirect if(substr($dest, 0, 2) == './') { - redirect(ereg_replace('/[^/]*$', substr($dest, 1), this_url())); + redirect(preg_replace('|/[^/]*$|', substr($dest, 1), this_url())); exit(); } @@ -49,8 +49,8 @@ function wfpl_main($dest = false) { } else { # no dest arg $basename = $_SERVER['REDIRECT_URL']; - $basename = ereg_replace('.*/', '', $basename); - $basename = ereg_replace('\.html?$', '', $basename); + $basename = preg_replace('|.*/|', '', $basename); + $basename = preg_replace('|\.html?$|', '', $basename); if($basename == '') { $basename = 'index'; } @@ -77,7 +77,7 @@ function wfpl_main($dest = false) { if(function_exists('cms_display')) { $cms_content = cms_display($basename, $GLOBALS['wfpl_main_template']); if(is_string($cms_content)) { - run_php($cms_content); + wfpl_main($cms_content); return; } } else { @@ -88,7 +88,7 @@ function wfpl_main($dest = false) { header('HTTP/1.0 404 File Not Found'); if(file_exists('error_404.php') || file_exists('error_404.html')) { $GLOBALS['error_basename'] = $basename; - run_php('error_404'); + wfpl_main('error_404'); return; } else { echo '