Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php |
— | — | @@ -38,6 +38,10 @@ |
39 | 39 | $nun = is_object( $newusername ) ? $newusername->getText() : ''; |
40 | 40 | $submit = wfMsgHtml( 'renameusersubmit' ); |
41 | 41 | $token = $wgUser->editToken(); |
| 42 | + $is_checked = "checked='checked'"; |
| 43 | + if ( $wgRequest->wasPosted() && ! $wgRequest->getCheck( 'movepages' ) ) { |
| 44 | + $is_checked = ''; |
| 45 | + } |
42 | 46 | |
43 | 47 | $wgOut->addHTML( " |
44 | 48 | <!-- Current contributions limit is " . RENAMEUSER_CONTRIBLIMIT . " --> |
— | — | @@ -56,7 +60,7 @@ |
57 | 61 | <tr> |
58 | 62 | <td> </td> |
59 | 63 | <td> |
60 | | - <input tabindex='3' type='checkbox' name='movepages' id='movepages' checked='checked' /> |
| 64 | + <input tabindex='3' type='checkbox' name='movepages' id='movepages' $is_checked /> |
61 | 65 | <label for='movepages'>$movepages</label> |
62 | 66 | </td> |
63 | 67 | </tr>" ); |
— | — | @@ -155,12 +159,15 @@ |
156 | 160 | |
157 | 161 | if ( $wgRequest->getCheck( 'movepages' ) && $wgUser->isAllowed( 'move' ) && version_compare( $wgVersion, '1.9alpha', '>=' ) ) { |
158 | 162 | $dbr =& wfGetDB( DB_SLAVE ); |
| 163 | + $oldkey = $oldusername->getDBKey(); |
159 | 164 | $pages = $dbr->select( |
160 | 165 | 'page', |
161 | 166 | array( 'page_namespace', 'page_title' ), |
162 | 167 | array( |
163 | 168 | 'page_namespace IN (' . NS_USER . ',' . NS_USER_TALK . ')', |
164 | | - '(page_title LIKE "' . $dbr->escapeLike( $oldusername->getDbKey() . '/' ) . '%" OR page_title = "' . $oldusername->getDbKey() . '")' |
| 169 | + '(page_title LIKE ' . |
| 170 | + $dbr->addQuotes( $dbr->escapeLike( $oldusername->getDbKey() ) . '/%' ) . |
| 171 | + ' OR page_title = ' . $dbr->addQuotes( $oldusername->getDbKey() ) . ')' |
165 | 172 | ), |
166 | 173 | __METHOD__ |
167 | 174 | ); |