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
use preg instead of ereg
[wfpl.git]
/
main.php
diff --git
a/main.php
b/main.php
index
3d4a751
..
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';
}