From: Aryeh Gregor Date: Tue, 3 Jun 2008 21:57:53 +0000 (+0000) Subject: (bug 14385) "Move subpages" option no longer tries to move to invalid titles. Patch... X-Git-Tag: 1.31.0-rc.0~47197 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=191cf61206ed3ed6cfee25ec8332f98bc77a70d7;p=lhc%2Fweb%2Fwiklou.git (bug 14385) "Move subpages" option no longer tries to move to invalid titles. Patch based on one by Mr.Z-man. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6a390cb719..0e4aead9bd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -323,6 +323,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11659) Urldecode image names in galleries * (bug 14258, 14368) Fix for subpage renames in replication environments * (bug 14367) Failed block no longer adds phantom watchlist entry +* (bug 14385) "Move subpages" option no longer tries to move to invalid titles === API changes in 1.13 === diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 5a61817b86..c5b80662b7 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -363,7 +363,14 @@ class MovePageForm { ); # The following line is an atrocious hack. Kill it with fire. $newNs = $nt->getNamespace() + ($oldPage->getNamespace() & 1); - $newPage = Title::makeTitle( $newNs, $newPageName ); + # Bug 14385: we need makeTitleSafe because the new page names may + # be longer than 255 characters. + $newPage = Title::makeTitleSafe( $newNs, $newPageName ); + if( !$newPage ) { + $oldLink = $skin->makeKnownLinkObj( $oldPage ); + $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, Title::makeName( $newNs, $newPageName ) ); + continue; + } # This was copy-pasted from Renameuser, bleh. if ( $newPage->exists() && !$oldPage->isValidMoveTarget( $newPage ) ) {