* (bug 2084) Fixed a regular expression in includes/Title.php that accepted
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Fri, 6 May 2005 03:25:02 +0000 (03:25 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Fri, 6 May 2005 03:25:02 +0000 (03:25 +0000)
  redirects with the syntax #REDIRECT [[foo], the old regular expression was
  \\[\\[([^\\]\\|]+)[\\]\\|] and the new one is \[{2}(.*?)(?:\||\]{2})

RELEASE-NOTES
includes/Title.php

index 12de8d9..b1362a9 100644 (file)
@@ -148,6 +148,7 @@ Various bugfixes, small features, and a few experimental things:
   revision id, useful for proper citation.
 * (bug 1998) Updated the Russian translation.
 * (bug 2064) Configurable JavaScript mimetype with $wgJsMimeType
+* (bug 2084) Fixed a regular expression in includes/Title.php that was accepting invalid syntax like #REDIRECT [[foo] in redirects
 * It's now possible to invert the namespace selection at Special:Allpages and Special:Contributions
 * No longer using sorbs.net to check for open proxies by default.
 * What was $wgDisableUploads is now $wgEnableUploads, and should be set to true if one wishes to enable uploads.
index 909b88f..288a5f2 100644 (file)
@@ -272,7 +272,7 @@ class Title {
                global $wgMwRedir;
                $rt = NULL;
                if ( $wgMwRedir->matchStart( $text ) ) {
-                       if ( preg_match( '/\\[\\[([^\\]\\|]+)[\\]\\|]/', $text, $m ) ) {
+                       if ( preg_match( '/\[{2}(.*?)(?:\||\]{2})/', $text, $m ) ) {
                                # categories are escaped using : for example one can enter:
                                # #REDIRECT [[:Category:Music]]. Need to remove it.
                                if ( substr($m[1],0,1) == ':') {