From 1bb1a2c843a6defa2961ea5acb66397e0ecd0f86 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 6 May 2005 03:25:02 +0000 Subject: [PATCH] * (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}) --- RELEASE-NOTES | 1 + includes/Title.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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) == ':') { -- 2.20.1