summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/pageutils.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index c10c1c4e8..4859465bb 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -123,8 +123,13 @@ function getNS($id){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function noNS($id){
- return preg_replace('/.*:/','',$id);
+function noNS($id) {
+ $pos = strrpos($id, ':');
+ if ($pos!==false) {
+ return substr($id, $pos+1);
+ } else {
+ return $id;
+ }
}
/**