From: Ævar Arnfjörð Bjarmason Date: Fri, 6 May 2005 03:25:02 +0000 (+0000) Subject: * (bug 2084) Fixed a regular expression in includes/Title.php that accepted X-Git-Tag: 1.5.0alpha2~292 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=1bb1a2c843a6defa2961ea5acb66397e0ecd0f86;p=lhc%2Fweb%2Fwiklou.git * (bug 2084) Fixed a regular expression in includes/Title.php that accepted redirects with the syntax #REDIRECT [[foo], the old regular expression was \\[\\[([^\\]\\|]+)[\\]\\|] and the new one is \[{2}(.*?)(?:\||\]{2}) --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 12de8d9d6f..b1362a9a66 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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. diff --git a/includes/Title.php b/includes/Title.php index 909b88f3cd..288a5f2f65 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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) == ':') {