Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix typo from preg/ereg change
[wfpl.git]
/
main.php
diff --git
a/main.php
b/main.php
index
e088d67
..
eae4de9
100644
(file)
--- 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) == './') {
# 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();
}
exit();
}
@@
-49,8
+49,8
@@
function wfpl_main($dest = false) {
} else { # no dest arg
$basename = $_SERVER['REDIRECT_URL'];
} 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';
}
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)) {
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 {
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;
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 '<!DOCTYPE html><html><head><title>404</title></head><body><h1>404 File Not Found</h1></body></html>';
return;
} else {
echo '<!DOCTYPE html><html><head><title>404</title></head><body><h1>404 File Not Found</h1></body></html>';
@@
-110,7
+110,7
@@
function wfpl_main($dest = false) {
# files can return a basename or URL of a page to be run/displayed
$other = file_run($php_file);
if($other) {
# files can return a basename or URL of a page to be run/displayed
$other = file_run($php_file);
if($other) {
- run_php($other);
+ wfpl_main($other);
return;
}
} elseif($html_exists) {
return;
}
} elseif($html_exists) {
@@
-121,12
+121,12
@@
function wfpl_main($dest = false) {
}
# Check for $GLOBALS['wfpl_template'] because it might have been set (or unset) by the php script.
}
# Check for $GLOBALS['wfpl_template'] because it might have been set (or unset) by the php script.
- if($GLOBALS['wfpl_template'] || $GLOBALS['wfpl_main_template']) {
- if($GLOBALS['wfpl_main_template']) {
+ if(isset($GLOBALS['wfpl_template']) || isset($GLOBALS['wfpl_main_template'])) {
+ if(isset($GLOBALS['wfpl_main_template'])) {
# if there was a template for that page, and one for the whole
# site, copy all template sections that have been show()n to the
# site-wide template
# if there was a template for that page, and one for the whole
# site, copy all template sections that have been show()n to the
# site-wide template
- if($GLOBALS['wfpl_template']) {
+ if(isset($GLOBALS['wfpl_template'])) {
$GLOBALS['wfpl_main_template']->merge($GLOBALS['wfpl_template']);
}
$GLOBALS['wfpl_main_template']->merge($GLOBALS['wfpl_template']);
}
@@
-134,8
+134,8
@@
function wfpl_main($dest = false) {
}
}
- # You'll probably want to require_once(__DIR__.'/'.'code/wfpl/messages.php') or
- # require_once(__DIR__.'/'.'code/wfpl/session_messages.php') in code/config.php
+ # You'll probably want to require_once(__DIR__.'/'.'lib/wfpl/messages.php') or
+ # require_once(__DIR__.'/'.'lib/wfpl/session_messages.php') in config.php
if(function_exists('display_messages')) {
if(function_exists('atexit_now')) {
atexit_now();
if(function_exists('display_messages')) {
if(function_exists('atexit_now')) {
atexit_now();