r50083 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50082‎ | r50083 | r50084 >
Date:22:23, 30 April 2009
Author:yaron
Status:deferred
Tags:
Comment:
Fixed moving pages when target string contains spaces
Modified paths:
  • /trunk/extensions/ReplaceText/SpecialReplaceText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReplaceText/SpecialReplaceText.php
@@ -158,7 +158,9 @@
159159 foreach ( $res as $row ) {
160160 $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
161161 // see if this move can happen
162 - $new_title = Title::makeTitleSafe( $row->page_namespace, str_replace( $this->target, $this->replacement, $row->page_title ) );
 162+ $cur_page_name = str_replace('_', ' ', $row->page_title);
 163+ $new_page_name = str_replace( $this->target, $this->replacement, $cur_page_name );
 164+ $new_title = Title::makeTitleSafe( $row->page_namespace, $new_page_name );
163165 $err = $title->isValidMoveOperation( $new_title );
164166 if ( $title->userCanMove( true ) && !is_array( $err ) ) {
165167 $titles_for_move[] = $title;

Status & tagging log