From 0969c9c2c4951784914a87027e042f0f83e376bd Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 22 Oct 2009 14:50:45 +0000 Subject: [PATCH] * (bug 21234) Moving subpages of titles containing \\ now works properly Per http://www.php.net/manual/en/function.preg-replace.php \ must be doubled in $replacement --- RELEASE-NOTES | 1 + includes/Title.php | 3 ++- includes/specials/SpecialMovepage.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3fe43f94ac..fc3a38dd7c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -584,6 +584,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 21161) Changing $wgCacheEpoch now always invalidates file cache * (bug 20268) Fixed row count estimation on SQLite backend * (bug 20275) Fixed LIKE queries on SQLite backend +* (bug 21234) Moving subpages of titles containing \\ now works properly == API changes in 1.16 == diff --git a/includes/Title.php b/includes/Title.php index 44df7314b9..e46152918b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3114,7 +3114,8 @@ class Title { continue; $newPageName = preg_replace( '#^'.preg_quote( $this->getDBkey(), '#' ).'#', - $nt->getDBkey(), $oldSubpage->getDBkey() ); + str_replace( '\\', '\\\\', $nt->getDBkey() ), # bug 21234 + $oldSubpage->getDBkey() ); if( $oldSubpage->isTalkPage() ) { $newNs = $nt->getTalkPage()->getNamespace(); } else { diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index ed5d03cc53..391cfbb137 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -458,7 +458,7 @@ class MovePageForm { $newPageName = preg_replace( '#^'.preg_quote( $ot->getDBkey(), '#' ).'#', - $nt->getDBkey(), + str_replace( '\\', '\\\\', $nt->getDBkey() ), # bug 21234 $oldSubpage->getDBkey() ); if( $oldSubpage->isTalkPage() ) { -- 2.20.1