Don't forget to escape things in regexps
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 10 May 2004 18:53:26 +0000 (18:53 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 10 May 2004 18:53:26 +0000 (18:53 +0000)
includes/Title.php

index c4d4973..3bee660 100644 (file)
@@ -498,7 +498,7 @@ class Title {
                if( Namespace::getUser() == $this->mNamespace
                        and preg_match("/\\.(css|js)$/", $this->mTextform )
                        and !$wgUser->isSysop()
-                       and !preg_match("/^".$wgUser->getName()."/", $this->mTextform) )
+                       and !preg_match("/^".preg_quote($wgUser->getName(), '/')."/", $this->mTextform) )
                { return false; }
                $ur = $wgUser->getRights();
                foreach ( $this->getRestrictions() as $r ) {