]> git.wh0rd.org - tt-rss.git/commitdiff
do not use regexps in get_self_url_prefix()
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 9 Dec 2012 09:32:09 +0000 (13:32 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 9 Dec 2012 09:32:14 +0000 (13:32 +0400)
include/functions.php

index 95881dd9e10a7d957868903c7d72d787c96b8a15..53aaa92b33155c390d2660429c1d8762c4d618ef 100644 (file)
                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){