summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-09 13:32:09 +0400
committerAndrew Dolgov <[email protected]>2012-12-09 13:32:14 +0400
commit51cc387347668e98b1b8e6c6053581a2affc5fa6 (patch)
tree33a2943659c74793b67bb6b1a8f525d6e071941c
parentbe1af6703f78998ddd5e07f965816dda74b8d133 (diff)
do not use regexps in get_self_url_prefix()
-rw-r--r--include/functions.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php
index 95881dd9e..53aaa92b3 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -3405,9 +3405,12 @@
return $tag;
}
- // we need to placate idiots who don't know any better
function get_self_url_prefix() {
- return preg_replace("/\/$/", "", SELF_URL_PATH);
+ if (strrpos(SELF_URL_PATH, "/") === strlen(SELF_URL_PATH)-1) {
+ return substr(SELF_URL_PATH, 0, strlen(SELF_URL_PATH)-1);
+ } else {
+ return SELF_URL_PATH;
+ }
}
function opml_publish_url($link){