# 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();
}
} 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';
}
}
# 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($GLOBALS['wfpl_template']) {
+ if(isset($GLOBALS['wfpl_template'])) {
$GLOBALS['wfpl_main_template']->merge($GLOBALS['wfpl_template']);
}