* (bug 21234) Moving subpages of titles containing \\ now works properly
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 22 Oct 2009 14:50:45 +0000 (14:50 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 22 Oct 2009 14:50:45 +0000 (14:50 +0000)
Per http://www.php.net/manual/en/function.preg-replace.php \ must be doubled in $replacement

RELEASE-NOTES
includes/Title.php
includes/specials/SpecialMovepage.php

index 3fe43f9..fc3a38d 100644 (file)
@@ -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 ==
 
index 44df731..e461529 100644 (file)
@@ -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 {
index ed5d03c..391cfbb 100644 (file)
@@ -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() ) {