Index: trunk/extensions/ReplaceText/SpecialReplaceText.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | wfLoadExtensionMessages('ReplaceText'); |
14 | 14 | } |
15 | 15 | |
16 | | - function execute( $para ) { |
| 16 | + function execute( $query ) { |
17 | 17 | global $wgUser, $wgOut; |
18 | 18 | |
19 | 19 | if ( ! $wgUser->isAllowed('replacetext') ) { |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | $res = $dbr->query($sql); |
157 | 157 | $contextchars = $wgUser->getOption( 'contextchars', 40 ); |
158 | 158 | while( $row = $dbr->fetchObject( $res ) ) { |
159 | | - $title = Title::newFromText($row->title, $row->namespace); |
| 159 | + $title = Title::makeTitleSafe($row->namespace, $row->title); |
160 | 160 | $article_text = $row->text; |
161 | 161 | $target_pos = strpos($article_text, $target_str); |
162 | 162 | $context_str = str_replace($angle_brackets, $escaped_angle_brackets, $wgContLang->truncate(substr($article_text, 0, $target_pos), -$contextchars, '...' )); |
— | — | @@ -172,11 +172,11 @@ |
173 | 173 | ORDER BY p.page_namespace, p.page_title"; |
174 | 174 | $res = $dbr->query($sql2); |
175 | 175 | while( $row = $dbr->fetchObject( $res ) ) { |
176 | | - $title = Title::newFromText($row->title, $row->namespace); |
| 176 | + $title = Title::makeTitleSafe($row->namespace, $row->title); |
177 | 177 | // see if this move can happen |
178 | 178 | $cur_page_name = str_replace('_', ' ', $row->title); |
179 | 179 | $new_page_name = str_replace($target_str, $replacement_str, $cur_page_name); |
180 | | - $new_title = Title::newFromText($new_page_name, $row->namespace); |
| 180 | + $new_title = Title::makeTitleSafe($row->namespace, $new_page_name); |
181 | 181 | $err = $title->isValidMoveOperation($new_title); |
182 | 182 | if ($title->userCanMove(true) && (! is_array($err))) { |
183 | 183 | $titles_for_move[] = $title; |
— | — | @@ -225,12 +225,14 @@ |
226 | 226 | END; |
227 | 227 | foreach ($found_titles as $value_pair) { |
228 | 228 | list($title, $context_str) = $value_pair; |
229 | | - $text .= "<input type=\"checkbox\" name=\"{$title->getArticleID()}\" checked /> {$skin->makeLinkObj( $title, $title->prefix($title->getText()) )} - <small>$context_str</small><br />\n"; |
| 229 | + $text .= Xml::check($title->getArticleID(), true); |
| 230 | + $text .= " " . $skin->makeLinkObj( $title, $title->prefix($title->getText()) ) . " - <small>$context_str</small><br />\n"; |
230 | 231 | } |
231 | 232 | if (count($titles_for_move) > 0) { |
232 | 233 | $text .= "<p>$choose_pages_for_move_label</p>\n"; |
233 | 234 | foreach ($titles_for_move as $title) { |
234 | | - $text .= "<input type=\"checkbox\" name=\"move-{$title->getArticleID()}\" checked /> {$skin->makeLinkObj( $title, $title->prefix($title->getText()) )}<br />\n"; |
| 235 | + $text .= Xml::check('move-' . $title->getArticleID(), true); |
| 236 | + $text .= " " . $skin->makeLinkObj( $title, $title->prefix($title->getText()) ) . "<br />\n"; |
235 | 237 | } |
236 | 238 | } |
237 | 239 | $text .=<<<END |