Index: trunk/phase3/includes/specials/SpecialAllpages.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | * @file |
22 | 22 | * @ingroup SpecialPage |
23 | 23 | */ |
24 | | - |
| 24 | + |
25 | 25 | /** |
26 | 26 | * Implements Special:Allpages |
27 | 27 | * |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | $namespaces = $wgContLang->getNamespaces(); |
74 | 74 | |
75 | | - $wgOut->setPagetitle( |
| 75 | + $wgOut->setPagetitle( |
76 | 76 | ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ? |
77 | 77 | wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) : |
78 | 78 | wfMsg( 'allarticles' ) |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) { |
99 | 99 | global $wgScript; |
100 | 100 | $t = $this->getTitle(); |
101 | | - |
| 101 | + |
102 | 102 | $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); |
103 | 103 | $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
104 | 104 | $out .= Html::hidden( 'title', $t->getPrefixedText() ); |
— | — | @@ -374,7 +374,7 @@ |
375 | 375 | 'page_title', |
376 | 376 | array( 'page_namespace' => $namespace, 'page_title < '.$dbr->addQuotes($from) ), |
377 | 377 | __METHOD__, |
378 | | - array( 'ORDER BY' => 'page_title DESC', |
| 378 | + array( 'ORDER BY' => 'page_title DESC', |
379 | 379 | 'LIMIT' => $this->maxPerPage, 'OFFSET' => ($this->maxPerPage - 1 ) |
380 | 380 | ) |
381 | 381 | ); |
Index: trunk/phase3/includes/specials/SpecialUnblock.php |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | break; |
144 | 144 | } |
145 | 145 | } |
146 | | - |
| 146 | + |
147 | 147 | } else { |
148 | 148 | $fields['Target']['default'] = $this->target; |
149 | 149 | unset( $fields['Name'] ); |
Index: trunk/phase3/includes/specials/SpecialUserrights.php |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | $user->removeGroup( $group ); |
224 | 224 | } |
225 | 225 | } |
226 | | - if( $add ) { |
| 226 | + if( $add ) { |
227 | 227 | $newGroups = array_merge( $newGroups, $add ); |
228 | 228 | foreach( $add as $group ) { |
229 | 229 | $user->addGroup( $group ); |
Index: trunk/phase3/includes/specials/SpecialAllmessages.php |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | protected $mSkin; |
169 | 169 | |
170 | 170 | /** |
171 | | - * @var Language |
| 171 | + * @var Language |
172 | 172 | */ |
173 | 173 | public $lang; |
174 | 174 | |
Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php |
— | — | @@ -172,16 +172,16 @@ |
173 | 173 | else |
174 | 174 | $order = array(); |
175 | 175 | |
176 | | - |
177 | | - $query = $dbr->selectSQLText( |
178 | | - array_merge( $tables, array( $link_table ) ), |
179 | | - $select, |
| 176 | + |
| 177 | + $query = $dbr->selectSQLText( |
| 178 | + array_merge( $tables, array( $link_table ) ), |
| 179 | + $select, |
180 | 180 | $conds + $subconds, |
181 | | - __METHOD__, |
| 181 | + __METHOD__, |
182 | 182 | $order + $query_options, |
183 | 183 | $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) ) |
184 | 184 | ); |
185 | | - |
| 185 | + |
186 | 186 | if( $dbr->unionSupportsOrderAndLimit()) |
187 | 187 | $query = $dbr->limitResult( $query, $limit ); |
188 | 188 | |
— | — | @@ -197,7 +197,7 @@ |
198 | 198 | $sql = $dbr->unionQueries($subsql, false).' ORDER BY rc_timestamp DESC'; |
199 | 199 | $sql = $dbr->limitResult($sql, $limit, false); |
200 | 200 | } |
201 | | - |
| 201 | + |
202 | 202 | $res = $dbr->query( $sql, __METHOD__ ); |
203 | 203 | |
204 | 204 | if( $res->numRows() == 0 ) |
— | — | @@ -205,7 +205,7 @@ |
206 | 206 | |
207 | 207 | return $res; |
208 | 208 | } |
209 | | - |
| 209 | + |
210 | 210 | function getExtraOptions( $opts ){ |
211 | 211 | $opts->consumeValues( array( 'showlinkedto', 'target', 'tagfilter' ) ); |
212 | 212 | $extraOpts = array(); |
— | — | @@ -252,7 +252,7 @@ |
253 | 253 | |
254 | 254 | function setBottomText( OutputPage $out, FormOptions $opts ) { |
255 | 255 | if( isset( $this->mResultEmpty ) && $this->mResultEmpty ){ |
256 | | - $out->addWikiMsg( 'recentchangeslinked-noresult' ); |
| 256 | + $out->addWikiMsg( 'recentchangeslinked-noresult' ); |
257 | 257 | } |
258 | 258 | } |
259 | 259 | } |
Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | $res = $dbr->select( 'archive', |
113 | 113 | array( 'ar_minor_edit', 'ar_timestamp', 'ar_user', 'ar_user_text', 'ar_comment', 'ar_len', 'ar_deleted' ), |
114 | 114 | array( 'ar_namespace' => $this->title->getNamespace(), |
115 | | - 'ar_title' => $this->title->getDBkey() ), |
| 115 | + 'ar_title' => $this->title->getDBkey() ), |
116 | 116 | 'PageArchive::listRevisions', |
117 | 117 | array( 'ORDER BY' => 'ar_timestamp DESC' ) ); |
118 | 118 | $ret = $dbr->resultObject( $res ); |
— | — | @@ -194,8 +194,8 @@ |
195 | 195 | 'ar_deleted', |
196 | 196 | 'ar_len' ), |
197 | 197 | array( 'ar_namespace' => $this->title->getNamespace(), |
198 | | - 'ar_title' => $this->title->getDBkey(), |
199 | | - 'ar_timestamp' => $dbr->timestamp( $timestamp ) ), |
| 198 | + 'ar_title' => $this->title->getDBkey(), |
| 199 | + 'ar_timestamp' => $dbr->timestamp( $timestamp ) ), |
200 | 200 | __METHOD__ ); |
201 | 201 | if( $row ) { |
202 | 202 | return Revision::newFromArchiveRow( $row, array( 'page' => $this->title->getArticleId() ) ); |
— | — | @@ -221,8 +221,8 @@ |
222 | 222 | $row = $dbr->selectRow( 'archive', |
223 | 223 | 'ar_timestamp', |
224 | 224 | array( 'ar_namespace' => $this->title->getNamespace(), |
225 | | - 'ar_title' => $this->title->getDBkey(), |
226 | | - 'ar_timestamp < ' . |
| 225 | + 'ar_title' => $this->title->getDBkey(), |
| 226 | + 'ar_timestamp < ' . |
227 | 227 | $dbr->addQuotes( $dbr->timestamp( $timestamp ) ) ), |
228 | 228 | __METHOD__, |
229 | 229 | array( |
— | — | @@ -293,7 +293,7 @@ |
294 | 294 | $row = $dbr->selectRow( 'archive', |
295 | 295 | array( 'ar_text', 'ar_flags', 'ar_text_id' ), |
296 | 296 | array( 'ar_namespace' => $this->title->getNamespace(), |
297 | | - 'ar_title' => $this->title->getDBkey() ), |
| 297 | + 'ar_title' => $this->title->getDBkey() ), |
298 | 298 | __METHOD__, |
299 | 299 | array( 'ORDER BY' => 'ar_timestamp DESC' ) ); |
300 | 300 | if( $row ) { |
— | — | @@ -312,7 +312,7 @@ |
313 | 313 | $dbr = wfGetDB( DB_SLAVE ); |
314 | 314 | $n = $dbr->selectField( 'archive', 'COUNT(ar_title)', |
315 | 315 | array( 'ar_namespace' => $this->title->getNamespace(), |
316 | | - 'ar_title' => $this->title->getDBkey() ) ); |
| 316 | + 'ar_title' => $this->title->getDBkey() ) ); |
317 | 317 | return ($n > 0); |
318 | 318 | } |
319 | 319 | |
— | — | @@ -407,7 +407,7 @@ |
408 | 408 | $page = $dbw->selectRow( 'page', |
409 | 409 | array( 'page_id', 'page_latest' ), |
410 | 410 | array( 'page_namespace' => $this->title->getNamespace(), |
411 | | - 'page_title' => $this->title->getDBkey() ), |
| 411 | + 'page_title' => $this->title->getDBkey() ), |
412 | 412 | __METHOD__, |
413 | 413 | $options |
414 | 414 | ); |
Index: trunk/phase3/includes/specials/SpecialImport.php |
— | — | @@ -30,14 +30,14 @@ |
31 | 31 | * @ingroup SpecialPage |
32 | 32 | */ |
33 | 33 | class SpecialImport extends SpecialPage { |
34 | | - |
| 34 | + |
35 | 35 | private $interwiki = false; |
36 | 36 | private $namespace; |
37 | 37 | private $frompage = ''; |
38 | 38 | private $logcomment= false; |
39 | 39 | private $history = true; |
40 | 40 | private $includeTemplates = false; |
41 | | - |
| 41 | + |
42 | 42 | /** |
43 | 43 | * Constructor |
44 | 44 | */ |
— | — | @@ -46,28 +46,28 @@ |
47 | 47 | global $wgImportTargetNamespace; |
48 | 48 | $this->namespace = $wgImportTargetNamespace; |
49 | 49 | } |
50 | | - |
| 50 | + |
51 | 51 | /** |
52 | 52 | * Execute |
53 | 53 | */ |
54 | 54 | function execute( $par ) { |
55 | 55 | global $wgRequest; |
56 | | - |
| 56 | + |
57 | 57 | $this->setHeaders(); |
58 | 58 | $this->outputHeader(); |
59 | | - |
| 59 | + |
60 | 60 | if ( wfReadOnly() ) { |
61 | 61 | global $wgOut; |
62 | 62 | $wgOut->readOnlyPage(); |
63 | 63 | return; |
64 | 64 | } |
65 | | - |
| 65 | + |
66 | 66 | if ( $wgRequest->wasPosted() && $wgRequest->getVal( 'action' ) == 'submit' ) { |
67 | 67 | $this->doImport(); |
68 | 68 | } |
69 | 69 | $this->showForm(); |
70 | 70 | } |
71 | | - |
| 71 | + |
72 | 72 | /** |
73 | 73 | * Do the actual import |
74 | 74 | */ |
— | — | @@ -290,8 +290,8 @@ |
291 | 291 | private $mLogItemCount = 0; |
292 | 292 | |
293 | 293 | function __construct( $importer, $upload, $interwiki , $reason=false ) { |
294 | | - $this->mOriginalPageOutCallback = |
295 | | - $importer->setPageOutCallback( array( $this, 'reportPage' ) ); |
| 294 | + $this->mOriginalPageOutCallback = |
| 295 | + $importer->setPageOutCallback( array( $this, 'reportPage' ) ); |
296 | 296 | $this->mOriginalLogCallback = |
297 | 297 | $importer->setLogItemCallback( array( $this, 'reportLogItem' ) ); |
298 | 298 | $this->mPageCount = 0; |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | global $wgOut; |
306 | 306 | $wgOut->addHTML( "<ul>\n" ); |
307 | 307 | } |
308 | | - |
| 308 | + |
309 | 309 | function reportLogItem( /* ... */ ) { |
310 | 310 | $this->mLogItemCount++; |
311 | 311 | if ( is_callable( $this->mOriginalLogCallback ) ) { |
— | — | @@ -314,7 +314,7 @@ |
315 | 315 | |
316 | 316 | function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) { |
317 | 317 | global $wgOut, $wgUser, $wgLang, $wgContLang; |
318 | | - |
| 318 | + |
319 | 319 | $args = func_get_args(); |
320 | 320 | call_user_func_array( $this->mOriginalPageOutCallback, $args ); |
321 | 321 | |
— | — | @@ -367,7 +367,7 @@ |
368 | 368 | |
369 | 369 | function close() { |
370 | 370 | global $wgOut, $wgLang; |
371 | | - |
| 371 | + |
372 | 372 | if ( $this->mLogItemCount > 0 ) { |
373 | 373 | $msg = wfMsgExt( 'imported-log-entries', 'parseinline', |
374 | 374 | $wgLang->formatNum( $this->mLogItemCount ) ); |
Index: trunk/phase3/includes/specials/SpecialExport.php |
— | — | @@ -92,13 +92,13 @@ |
93 | 93 | $page = $wgRequest->getText( 'pages' ); |
94 | 94 | $this->curonly = $wgRequest->getCheck( 'curonly' ); |
95 | 95 | $rawOffset = $wgRequest->getVal( 'offset' ); |
96 | | - |
| 96 | + |
97 | 97 | if( $rawOffset ) { |
98 | 98 | $offset = wfTimestamp( TS_MW, $rawOffset ); |
99 | 99 | } else { |
100 | 100 | $offset = null; |
101 | 101 | } |
102 | | - |
| 102 | + |
103 | 103 | $limit = $wgRequest->getInt( 'limit' ); |
104 | 104 | $dir = $wgRequest->getVal( 'dir' ); |
105 | 105 | $history = array( |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | 'limit' => $wgExportMaxHistory, |
109 | 109 | ); |
110 | 110 | $historyCheck = $wgRequest->getCheck( 'history' ); |
111 | | - |
| 111 | + |
112 | 112 | if ( $this->curonly ) { |
113 | 113 | $history = WikiExporter::CURRENT; |
114 | 114 | } elseif ( !$historyCheck ) { |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | // Default to current-only for GET requests. |
131 | 131 | $page = $wgRequest->getText( 'pages', $par ); |
132 | 132 | $historyCheck = $wgRequest->getCheck( 'history' ); |
133 | | - |
| 133 | + |
134 | 134 | if( $historyCheck ) { |
135 | 135 | $history = WikiExporter::FULL; |
136 | 136 | } else { |
— | — | @@ -153,20 +153,20 @@ |
154 | 154 | |
155 | 155 | if ( $this->doExport ) { |
156 | 156 | $wgOut->disable(); |
157 | | - |
| 157 | + |
158 | 158 | // Cancel output buffering and gzipping if set |
159 | 159 | // This should provide safer streaming for pages with history |
160 | 160 | wfResetOutputBuffers(); |
161 | 161 | $wgRequest->response()->header( "Content-type: application/xml; charset=utf-8" ); |
162 | | - |
| 162 | + |
163 | 163 | if( $wgRequest->getCheck( 'wpDownload' ) ) { |
164 | 164 | // Provide a sane filename suggestion |
165 | 165 | $filename = urlencode( $wgSitename . '-' . wfTimestampNow() . '.xml' ); |
166 | 166 | $wgRequest->response()->header( "Content-disposition: attachment;filename={$filename}" ); |
167 | 167 | } |
168 | | - |
| 168 | + |
169 | 169 | $this->doExport( $page, $history, $list_authors ); |
170 | | - |
| 170 | + |
171 | 171 | return; |
172 | 172 | } |
173 | 173 | |
— | — | @@ -195,14 +195,14 @@ |
196 | 196 | } else { |
197 | 197 | $wgOut->addHTML( wfMsgExt( 'exportnohistory', 'parse' ) ); |
198 | 198 | } |
199 | | - |
| 199 | + |
200 | 200 | $form .= Xml::checkLabel( |
201 | | - wfMsg( 'export-templates' ), |
202 | | - 'templates', |
203 | | - 'wpExportTemplates', |
| 201 | + wfMsg( 'export-templates' ), |
| 202 | + 'templates', |
| 203 | + 'wpExportTemplates', |
204 | 204 | $wgRequest->wasPosted() ? $wgRequest->getCheck( 'templates' ) : false |
205 | 205 | ) . '<br />'; |
206 | | - |
| 206 | + |
207 | 207 | if( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) { |
208 | 208 | $form .= Xml::inputLabel( wfMsg( 'export-pagelinks' ), 'pagelink-depth', 'pagelink-depth', 20, 0 ) . '<br />'; |
209 | 209 | } |
— | — | @@ -217,7 +217,7 @@ |
218 | 218 | |
219 | 219 | $form .= Xml::submitButton( wfMsg( 'export-submit' ), $wgUser->getSkin()->tooltipAndAccessKeyAttribs( 'export' ) ); |
220 | 220 | $form .= Xml::closeElement( 'form' ); |
221 | | - |
| 221 | + |
222 | 222 | $wgOut->addHTML( $form ); |
223 | 223 | } |
224 | 224 | |
— | — | @@ -272,7 +272,7 @@ |
273 | 273 | foreach( $pages as $k => $v ) { |
274 | 274 | $pages[$k] = str_replace( " ", "_", $v ); |
275 | 275 | } |
276 | | - |
| 276 | + |
277 | 277 | $pages = array_unique( $pages ); |
278 | 278 | |
279 | 279 | /* Ok, let's get to it... */ |
— | — | @@ -291,11 +291,11 @@ |
292 | 292 | set_time_limit(0); |
293 | 293 | wfRestoreWarnings(); |
294 | 294 | } |
295 | | - |
| 295 | + |
296 | 296 | $exporter = new WikiExporter( $db, $history, $buffer ); |
297 | 297 | $exporter->list_authors = $list_authors; |
298 | 298 | $exporter->openStream(); |
299 | | - |
| 299 | + |
300 | 300 | foreach( $pages as $page ) { |
301 | 301 | /* |
302 | 302 | if( $wgExportMaxHistory && !$this->curonly ) { |
— | — | @@ -322,7 +322,7 @@ |
323 | 323 | } |
324 | 324 | |
325 | 325 | $exporter->closeStream(); |
326 | | - |
| 326 | + |
327 | 327 | if( $lb ) { |
328 | 328 | $lb->closeAll(); |
329 | 329 | } |
— | — | @@ -343,7 +343,7 @@ |
344 | 344 | ); |
345 | 345 | |
346 | 346 | $pages = array(); |
347 | | - |
| 347 | + |
348 | 348 | foreach ( $res as $row ) { |
349 | 349 | $n = $row->page_title; |
350 | 350 | if ($row->page_namespace) { |
— | — | @@ -369,10 +369,10 @@ |
370 | 370 | ); |
371 | 371 | |
372 | 372 | $pages = array(); |
373 | | - |
| 373 | + |
374 | 374 | foreach ( $res as $row ) { |
375 | 375 | $n = $row->page_title; |
376 | | - |
| 376 | + |
377 | 377 | if ( $row->page_namespace ) { |
378 | 378 | $ns = $wgContLang->getNsText( $row->page_namespace ); |
379 | 379 | $n = $ns . ':' . $n; |
— | — | @@ -402,17 +402,17 @@ |
403 | 403 | */ |
404 | 404 | private function validateLinkDepth( $depth ) { |
405 | 405 | global $wgExportMaxLinkDepth; |
406 | | - |
| 406 | + |
407 | 407 | if( $depth < 0 ) { |
408 | 408 | return 0; |
409 | 409 | } |
410 | | - |
| 410 | + |
411 | 411 | if ( !$this->userCanOverrideExportDepth() ) { |
412 | 412 | if( $depth > $wgExportMaxLinkDepth ) { |
413 | 413 | return $wgExportMaxLinkDepth; |
414 | 414 | } |
415 | 415 | } |
416 | | - |
| 416 | + |
417 | 417 | /* |
418 | 418 | * There's a HARD CODED limit of 5 levels of recursion here to prevent a |
419 | 419 | * crazy-big export from being done by someone setting the depth |
— | — | @@ -426,21 +426,21 @@ |
427 | 427 | for( ; $depth > 0; --$depth ) { |
428 | 428 | $pageSet = $this->getLinks( |
429 | 429 | $inputPages, $pageSet, 'pagelinks', |
430 | | - array( 'pl_namespace AS namespace', 'pl_title AS title' ), |
| 430 | + array( 'pl_namespace AS namespace', 'pl_title AS title' ), |
431 | 431 | array( 'page_id=pl_from' ) |
432 | 432 | ); |
433 | 433 | $inputPages = array_keys( $pageSet ); |
434 | 434 | } |
435 | | - |
| 435 | + |
436 | 436 | return $pageSet; |
437 | 437 | } |
438 | 438 | |
439 | 439 | /** |
440 | 440 | * Expand a list of pages to include images used in those pages. |
441 | | - * |
| 441 | + * |
442 | 442 | * @param $inputPages array, list of titles to look up |
443 | 443 | * @param $pageSet array, associative array indexed by titles for output |
444 | | - * |
| 444 | + * |
445 | 445 | * @return array associative array index by titles |
446 | 446 | */ |
447 | 447 | private function getImages( $inputPages, $pageSet ) { |
— | — | @@ -458,10 +458,10 @@ |
459 | 459 | */ |
460 | 460 | private function getLinks( $inputPages, $pageSet, $table, $fields, $join ) { |
461 | 461 | $dbr = wfGetDB( DB_SLAVE ); |
462 | | - |
| 462 | + |
463 | 463 | foreach( $inputPages as $page ) { |
464 | 464 | $title = Title::newFromText( $page ); |
465 | | - |
| 465 | + |
466 | 466 | if( $title ) { |
467 | 467 | $pageSet[$title->getPrefixedText()] = true; |
468 | 468 | /// @todo Fixme: May or may not be more efficient to batch these |
— | — | @@ -478,15 +478,15 @@ |
479 | 479 | ), |
480 | 480 | __METHOD__ |
481 | 481 | ); |
482 | | - |
| 482 | + |
483 | 483 | foreach( $result as $row ) { |
484 | 484 | $template = Title::makeTitle( $row->namespace, $row->title ); |
485 | 485 | $pageSet[$template->getPrefixedText()] = true; |
486 | 486 | } |
487 | 487 | } |
488 | 488 | } |
489 | | - |
| 489 | + |
490 | 490 | return $pageSet; |
491 | 491 | } |
492 | | - |
| 492 | + |
493 | 493 | } |
Index: trunk/phase3/includes/specials/SpecialDisambiguations.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | $set = 'FALSE'; |
79 | 79 | wfDebug("Mediawiki:disambiguationspage message does not link to any templates!\n"); |
80 | 80 | } |
81 | | - |
| 81 | + |
82 | 82 | // FIXME: What are pagelinks and p2 doing here? |
83 | 83 | return array ( |
84 | 84 | 'tables' => array( 'templatelinks', 'p1' => 'page', 'pagelinks', 'p2' => 'page' ), |
— | — | @@ -96,11 +96,11 @@ |
97 | 97 | function getOrderFields() { |
98 | 98 | return array( 'tl_namespace', 'tl_title', 'value' ); |
99 | 99 | } |
100 | | - |
| 100 | + |
101 | 101 | function sortDescending() { |
102 | 102 | return false; |
103 | 103 | } |
104 | | - |
| 104 | + |
105 | 105 | /** |
106 | 106 | * Fetch links and cache their existence |
107 | 107 | */ |
Index: trunk/phase3/includes/specials/SpecialMostrevisions.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | function __construct( $name = 'Mostrevisions' ) { |
29 | 29 | parent::__construct( $name ); |
30 | 30 | } |
31 | | - |
| 31 | + |
32 | 32 | function sortDescending() { |
33 | 33 | return true; |
34 | 34 | } |
Index: trunk/phase3/includes/specials/SpecialBrokenRedirects.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | function __construct( $name = 'BrokenRedirects' ) { |
34 | 34 | parent::__construct( $name ); |
35 | 35 | } |
36 | | - |
| 36 | + |
37 | 37 | function isExpensive() { return true; } |
38 | 38 | function isSyndicated() { return false; } |
39 | 39 | function sortDescending() { return false; } |
Index: trunk/phase3/includes/specials/SpecialCategories.php |
— | — | @@ -69,12 +69,12 @@ |
70 | 70 | $this->mOffset = $from; |
71 | 71 | } |
72 | 72 | } |
73 | | - |
| 73 | + |
74 | 74 | function getQueryInfo() { |
75 | 75 | return array( |
76 | 76 | 'tables' => array( 'category' ), |
77 | 77 | 'fields' => array( 'cat_title','cat_pages' ), |
78 | | - 'conds' => array( 'cat_pages > 0' ), |
| 78 | + 'conds' => array( 'cat_pages > 0' ), |
79 | 79 | 'options' => array( 'USE INDEX' => 'cat_title' ), |
80 | 80 | ); |
81 | 81 | } |
— | — | @@ -121,11 +121,11 @@ |
122 | 122 | $wgLang->formatNum( $result->cat_pages ) ); |
123 | 123 | return Xml::tags('li', null, "$titleText ($count)" ) . "\n"; |
124 | 124 | } |
125 | | - |
| 125 | + |
126 | 126 | public function getStartForm( $from ) { |
127 | 127 | global $wgScript; |
128 | 128 | $t = SpecialPage::getTitleFor( 'Categories' ); |
129 | | - |
| 129 | + |
130 | 130 | return |
131 | 131 | Xml::tags( 'form', array( 'method' => 'get', 'action' => $wgScript ), |
132 | 132 | Html::hidden( 'title', $t->getPrefixedText() ) . |
Index: trunk/phase3/includes/specials/SpecialBlockList.php |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | $form->setWrapperLegend( wfMsg( 'ipblocklist-legend' ) ); |
87 | 87 | $form->setSubmitText( wfMsg( 'ipblocklist-submit' ) ); |
88 | 88 | $form->prepareForm(); |
89 | | - |
| 89 | + |
90 | 90 | $form->displayForm( '' ); |
91 | 91 | $this->showList(); |
92 | 92 | } |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | $chunk = self::getIpFragment( $start ); |
144 | 144 | $dbr = wfGetDB( DB_SLAVE ); |
145 | 145 | $like = $dbr->buildLike( $chunk, $dbr->anyString() ); |
146 | | - |
| 146 | + |
147 | 147 | # Fairly hard to make a malicious SQL statement out of hex characters, |
148 | 148 | # but stranger things have happened... |
149 | 149 | $safeStart = $dbr->addQuotes( IP::toHex( $start ) ); |
Index: trunk/phase3/includes/specials/SpecialMostcategories.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | function __construct( $name = 'Mostcategories' ) { |
36 | 36 | parent::__construct( $name ); |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | function isExpensive() { return true; } |
40 | 40 | function isSyndicated() { return false; } |
41 | 41 | |
Index: trunk/phase3/includes/specials/SpecialStatistics.php |
— | — | @@ -28,21 +28,21 @@ |
29 | 29 | * @ingroup SpecialPage |
30 | 30 | */ |
31 | 31 | class SpecialStatistics extends SpecialPage { |
32 | | - |
| 32 | + |
33 | 33 | private $views, $edits, $good, $images, $total, $users, |
34 | 34 | $activeUsers = 0; |
35 | | - |
| 35 | + |
36 | 36 | public function __construct() { |
37 | 37 | parent::__construct( 'Statistics' ); |
38 | 38 | } |
39 | | - |
| 39 | + |
40 | 40 | public function execute( $par ) { |
41 | 41 | global $wgOut, $wgMemc; |
42 | 42 | global $wgDisableCounters, $wgMiserMode; |
43 | | - |
| 43 | + |
44 | 44 | $this->setHeaders(); |
45 | 45 | $wgOut->addModuleStyles( 'mediawiki.special' ); |
46 | | - |
| 46 | + |
47 | 47 | $this->views = SiteStats::views(); |
48 | 48 | $this->edits = SiteStats::edits(); |
49 | 49 | $this->good = SiteStats::articles(); |
— | — | @@ -51,13 +51,13 @@ |
52 | 52 | $this->users = SiteStats::users(); |
53 | 53 | $this->activeUsers = SiteStats::activeUsers(); |
54 | 54 | $this->hook = ''; |
55 | | - |
| 55 | + |
56 | 56 | # Staticic - views |
57 | 57 | $viewsStats = ''; |
58 | 58 | if( !$wgDisableCounters ) { |
59 | 59 | $viewsStats = $this->getViewsStats(); |
60 | 60 | } |
61 | | - |
| 61 | + |
62 | 62 | # Set active user count |
63 | 63 | if( !$wgMiserMode ) { |
64 | 64 | $key = wfMemcKey( 'sitestats', 'activeusers-updated' ); |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | if( !$wgDisableCounters && !$wgMiserMode ) { |
90 | 90 | $text .= $this->getMostViewedPages(); |
91 | 91 | } |
92 | | - |
| 92 | + |
93 | 93 | # Statistic - other |
94 | 94 | $extraStats = array(); |
95 | 95 | if( wfRunHooks( 'SpecialStatsAddExtra', array( &$extraStats ) ) ) { |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | $msg = wfMessage( $descMsg, $descMsgParam ); |
122 | 122 | if ( $msg->exists() ) { |
123 | 123 | $descriptionText = $msg->parse(); |
124 | | - $text .= "<br />" . Xml::element( 'small', array( 'class' => 'mw-statistic-desc'), |
| 124 | + $text .= "<br />" . Xml::element( 'small', array( 'class' => 'mw-statistic-desc'), |
125 | 125 | " ($descriptionText)" ); |
126 | 126 | } |
127 | 127 | } |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | Html::rawElement( 'td', array( 'class' => 'mw-statistics-numbers' ), $number ) |
132 | 132 | ); |
133 | 133 | } |
134 | | - |
| 134 | + |
135 | 135 | /** |
136 | 136 | * Each of these methods is pretty self-explanatory, get a particular |
137 | 137 | * row for the table of statistics |
— | — | @@ -244,7 +244,7 @@ |
245 | 245 | $wgLang->formatNum( $this->views ), |
246 | 246 | array ( 'class' => 'mw-statistics-views-total' ), 'statistics-views-total-desc' ) . |
247 | 247 | $this->formatRow( wfMsgExt( 'statistics-views-peredit', array( 'parseinline' ) ), |
248 | | - $wgLang->formatNum( sprintf( '%.2f', $this->edits ? |
| 248 | + $wgLang->formatNum( sprintf( '%.2f', $this->edits ? |
249 | 249 | $this->views / $this->edits : 0 ) ), |
250 | 250 | array ( 'class' => 'mw-statistics-views-peredit' ) ); |
251 | 251 | } |
— | — | @@ -280,7 +280,7 @@ |
281 | 281 | if( $title instanceof Title ) { |
282 | 282 | $text .= $this->formatRow( $sk->link( $title ), |
283 | 283 | $wgLang->formatNum( $row->page_counter ) ); |
284 | | - |
| 284 | + |
285 | 285 | } |
286 | 286 | } |
287 | 287 | $res->free(); |
— | — | @@ -297,14 +297,14 @@ |
298 | 298 | $return = Xml::openElement( 'tr' ) . |
299 | 299 | Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-hooks', array( 'parseinline' ) ) ) . |
300 | 300 | Xml::closeElement( 'tr' ); |
301 | | - |
| 301 | + |
302 | 302 | foreach( $stats as $name => $number ) { |
303 | 303 | $name = htmlspecialchars( $name ); |
304 | 304 | $number = htmlspecialchars( $number ); |
305 | | - |
| 305 | + |
306 | 306 | $return .= $this->formatRow( $name, $wgLang->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) ); |
307 | 307 | } |
308 | | - |
| 308 | + |
309 | 309 | return $return; |
310 | 310 | } |
311 | 311 | } |
Index: trunk/phase3/includes/specials/SpecialFilepath.php |
— | — | @@ -46,14 +46,14 @@ |
47 | 47 | $this->showForm( $title ); |
48 | 48 | } else { |
49 | 49 | $file = wfFindFile( $title ); |
50 | | - |
| 50 | + |
51 | 51 | if ( $file && $file->exists() ) { |
52 | 52 | // Default behaviour: Use the direct link to the file. |
53 | 53 | $url = $file->getURL(); |
54 | 54 | $width = $wgRequest->getInt( 'width', -1 ); |
55 | 55 | $height = $wgRequest->getInt( 'height', -1 ); |
56 | 56 | |
57 | | - // If a width is requested... |
| 57 | + // If a width is requested... |
58 | 58 | if ( $width != -1 ) { |
59 | 59 | $mto = $file->transform( array( 'width' => $width, 'height' => $height ) ); |
60 | 60 | // ... and we can |
Index: trunk/phase3/includes/specials/SpecialListfiles.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | * @file |
22 | 22 | * @ingroup SpecialPage |
23 | 23 | */ |
24 | | - |
| 24 | + |
25 | 25 | function wfSpecialListfiles( $par = null ) { |
26 | 26 | global $wgOut; |
27 | 27 | |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | var $mFieldNames = null; |
41 | 41 | var $mQueryConds = array(); |
42 | 42 | var $mUserName = null; |
43 | | - |
| 43 | + |
44 | 44 | function __construct( $par = null ) { |
45 | 45 | global $wgRequest, $wgMiserMode; |
46 | 46 | if ( $wgRequest->getText( 'sort', 'img_date' ) == 'img_date' ) { |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | } else { |
49 | 49 | $this->mDefaultDirection = false; |
50 | 50 | } |
51 | | - |
| 51 | + |
52 | 52 | $userName = $wgRequest->getText( 'user', $par ); |
53 | 53 | if ( $userName ) { |
54 | 54 | $nt = Title::newFromText( $userName, NS_USER ); |
— | — | @@ -55,14 +55,14 @@ |
56 | 56 | $this->mUserName = $nt->getText(); |
57 | 57 | $this->mQueryConds['img_user_text'] = $this->mUserName; |
58 | 58 | } |
59 | | - } |
60 | | - |
| 59 | + } |
| 60 | + |
61 | 61 | $search = $wgRequest->getText( 'ilsearch' ); |
62 | 62 | if ( $search != '' && !$wgMiserMode ) { |
63 | 63 | $nt = Title::newFromURL( $search ); |
64 | 64 | if ( $nt ) { |
65 | 65 | $dbr = wfGetDB( DB_SLAVE ); |
66 | | - $this->mQueryConds[] = 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(), |
| 66 | + $this->mQueryConds[] = 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(), |
67 | 67 | strtolower( $nt->getDBkey() ), $dbr->anyString() ); |
68 | 68 | } |
69 | 69 | } |
— | — | @@ -232,7 +232,7 @@ |
233 | 233 | function getSortHeaderClass() { |
234 | 234 | return 'listfiles_sort ' . parent::getSortHeaderClass(); |
235 | 235 | } |
236 | | - |
| 236 | + |
237 | 237 | function getPagingQueries() { |
238 | 238 | $queries = parent::getPagingQueries(); |
239 | 239 | if ( !is_null( $this->mUserName ) ) { |
Index: trunk/phase3/includes/specials/SpecialSpecialpages.php |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | ); |
110 | 110 | foreach( $sortedPages as $desc => $specialpage ) { |
111 | 111 | list( $title, $restricted, $expensive) = $specialpage; |
112 | | - |
| 112 | + |
113 | 113 | $pageClasses = array(); |
114 | 114 | if ( $expensive && $wgMiserMode ){ |
115 | 115 | $includesCachedPages = true; |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | $includesRestrictedPages = true; |
120 | 120 | $pageClasses[] = 'mw-specialpagerestricted'; |
121 | 121 | } |
122 | | - |
| 122 | + |
123 | 123 | $link = $sk->linkKnown( $title , htmlspecialchars( $desc ) ); |
124 | 124 | $wgOut->addHTML( Html::rawElement( 'li', array( 'class' => implode( ' ', $pageClasses ) ), $link ) . "\n" ); |
125 | 125 | |
Index: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php |
— | — | @@ -89,13 +89,13 @@ |
90 | 90 | 'conds' => array( 'img_sha1' => $this->hash ) |
91 | 91 | ); |
92 | 92 | } |
93 | | - |
| 93 | + |
94 | 94 | function execute( $par ) { |
95 | 95 | global $wgRequest, $wgOut, $wgLang, $wgContLang, $wgScript; |
96 | | - |
| 96 | + |
97 | 97 | $this->setHeaders(); |
98 | 98 | $this->outputHeader(); |
99 | | - |
| 99 | + |
100 | 100 | $this->filename = isset( $par ) ? $par : $wgRequest->getText( 'filename' ); |
101 | 101 | $this->file = null; |
102 | 102 | $this->hash = ''; |
Index: trunk/phase3/includes/specials/SpecialPreferences.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | 'savedprefs' |
63 | 63 | ); |
64 | 64 | } |
65 | | - |
| 65 | + |
66 | 66 | if ( $wgRequest->getCheck( 'eauth' ) ) { |
67 | 67 | $wgOut->wrapWikiMsg( "<div class='error' style='clear: both;'>\n$1\n</div>", |
68 | 68 | 'eauthentsent', $wgUser->getName() ); |
Index: trunk/phase3/includes/specials/SpecialUnwatchedpages.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | function __construct( $name = 'Unwatchedpages' ) { |
36 | 36 | parent::__construct( $name, 'unwatchedpages' ); |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | function isExpensive() { return true; } |
40 | 40 | function isSyndicated() { return false; } |
41 | 41 | |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | } |
57 | 57 | |
58 | 58 | function sortDescending() { return false; } |
59 | | - |
| 59 | + |
60 | 60 | function getOrderFields() { |
61 | 61 | return array( 'page_namespace', 'page_title' ); |
62 | 62 | } |
Index: trunk/phase3/includes/specials/SpecialWantedfiles.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | function __construct( $name = 'Wantedfiles' ) { |
36 | 36 | parent::__construct( $name ); |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | /** |
40 | 40 | * KLUGE: The results may contain false positives for files |
41 | 41 | * that exist e.g. in a shared repo. Setting this at least |
— | — | @@ -53,10 +53,10 @@ |
54 | 54 | 'COUNT(*) AS value' ), |
55 | 55 | 'conds' => array ( 'img_name IS NULL' ), |
56 | 56 | 'options' => array ( 'GROUP BY' => 'il_to' ), |
57 | | - 'join_conds' => array ( 'image' => |
| 57 | + 'join_conds' => array ( 'image' => |
58 | 58 | array ( 'LEFT JOIN', |
59 | | - array ( 'il_to = img_name' ) |
60 | | - ) |
| 59 | + array ( 'il_to = img_name' ) |
| 60 | + ) |
61 | 61 | ) |
62 | 62 | ); |
63 | 63 | } |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -89,9 +89,9 @@ |
90 | 90 | $this->mPosted = $request->wasPosted(); |
91 | 91 | $this->mCreateaccount = $request->getCheck( 'wpCreateaccount' ); |
92 | 92 | $this->mCreateaccountMail = $request->getCheck( 'wpCreateaccountMail' ) |
93 | | - && $wgEnableEmail; |
| 93 | + && $wgEnableEmail; |
94 | 94 | $this->mMailmypassword = $request->getCheck( 'wpMailmypassword' ) |
95 | | - && $wgEnableEmail; |
| 95 | + && $wgEnableEmail; |
96 | 96 | $this->mLoginattempt = $request->getCheck( 'wpLoginattempt' ); |
97 | 97 | $this->mAction = $request->getVal( 'action' ); |
98 | 98 | $this->mRemember = $request->getCheck( 'wpRemember' ); |
— | — | @@ -111,9 +111,9 @@ |
112 | 112 | $this->mEmail = ''; |
113 | 113 | } |
114 | 114 | if( !in_array( 'realname', $wgHiddenPrefs ) ) { |
115 | | - $this->mRealName = $request->getText( 'wpRealName' ); |
| 115 | + $this->mRealName = $request->getText( 'wpRealName' ); |
116 | 116 | } else { |
117 | | - $this->mRealName = ''; |
| 117 | + $this->mRealName = ''; |
118 | 118 | } |
119 | 119 | |
120 | 120 | if( !$wgAuth->validDomain( $this->mDomain ) ) { |
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php |
— | — | @@ -381,7 +381,7 @@ |
382 | 382 | |
383 | 383 | # Build up the form |
384 | 384 | $f = Xml::openElement( 'form', array( 'action' => $wgScript ) ); |
385 | | - |
| 385 | + |
386 | 386 | # Values that should not be forgotten |
387 | 387 | $f .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ); |
388 | 388 | foreach ( $this->opts->getUnconsumedValues() as $name => $value ) { |
— | — | @@ -413,7 +413,7 @@ |
414 | 414 | |
415 | 415 | /** |
416 | 416 | * Create filter panel |
417 | | - * |
| 417 | + * |
418 | 418 | * @return string HTML fieldset and filter panel with the show/hide links |
419 | 419 | */ |
420 | 420 | function getFilterPanel() { |
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -298,8 +298,8 @@ |
299 | 299 | MWNamespace::getAssociated( $opts['namespace'] ) |
300 | 300 | ); |
301 | 301 | $condition = "(rc_namespace $operator $selectedNS " |
302 | | - . $boolean |
303 | | - . " rc_namespace $operator $associatedNS)"; |
| 302 | + . $boolean |
| 303 | + . " rc_namespace $operator $associatedNS)"; |
304 | 304 | } |
305 | 305 | |
306 | 306 | $conds[] = $condition; |
Index: trunk/phase3/includes/specials/SpecialLonelypages.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | function __construct( $name = 'Lonelypages' ) { |
34 | 34 | parent::__construct( $name ); |
35 | 35 | } |
36 | | - |
| 36 | + |
37 | 37 | function getPageHeader() { |
38 | 38 | return wfMsgExt( 'lonelypagestext', array( 'parse' ) ); |
39 | 39 | } |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | 'tl_title = page_title' ) ) ) |
70 | 70 | ); |
71 | 71 | } |
72 | | - |
| 72 | + |
73 | 73 | function getOrderFields() { |
74 | 74 | // For some crazy reason ordering by a constant |
75 | 75 | // causes a filesort in MySQL 5 |
Index: trunk/phase3/includes/specials/SpecialUncategorizedpages.php |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | 'LEFT JOIN', 'cl_from = page_id' ) ) |
60 | 60 | ); |
61 | 61 | } |
62 | | - |
| 62 | + |
63 | 63 | function getOrderFields() { |
64 | 64 | // For some crazy reason ordering by a constant |
65 | 65 | // causes a filesort |
Index: trunk/phase3/includes/specials/SpecialPrefixindex.php |
— | — | @@ -28,11 +28,11 @@ |
29 | 29 | */ |
30 | 30 | class SpecialPrefixindex extends SpecialAllpages { |
31 | 31 | // Inherit $maxPerPage |
32 | | - |
| 32 | + |
33 | 33 | function __construct(){ |
34 | 34 | parent::__construct( 'Prefixindex' ); |
35 | 35 | } |
36 | | - |
| 36 | + |
37 | 37 | /** |
38 | 38 | * Entry point : initialise variables and call subfunctions. |
39 | 39 | * @param $par String: becomes "FOO" when called like Special:Prefixindex/FOO (default null) |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | $wgOut->addHTML( $this->namespacePrefixForm( $namespace, null ) ); |
72 | 72 | } |
73 | 73 | } |
74 | | - |
| 74 | + |
75 | 75 | /** |
76 | 76 | * HTML for the top form |
77 | 77 | * @param $namespace Integer: a namespace constant (default NS_MAIN). |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | $n = 0; |
162 | 162 | if( $res->numRows() > 0 ) { |
163 | 163 | $out = Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-prefixindex-list-table' ) ); |
164 | | - |
| 164 | + |
165 | 165 | while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { |
166 | 166 | $t = Title::makeTitle( $s->page_namespace, $s->page_title ); |
167 | 167 | if( $t ) { |
Index: trunk/phase3/includes/specials/SpecialUploadStash.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | // UploadStash |
22 | 22 | private $stash; |
23 | 23 | |
24 | | - // Since we are directly writing the file to STDOUT, |
| 24 | + // Since we are directly writing the file to STDOUT, |
25 | 25 | // we should not be reading in really big files and serving them out. |
26 | 26 | // |
27 | 27 | // We also don't want people using this as a file drop, even if they |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | return $this->outputLocalFile( $params['file'] ); |
83 | 83 | } |
84 | 84 | } catch( UploadStashFileNotFoundException $e ) { |
85 | | - $code = 404; |
| 85 | + $code = 404; |
86 | 86 | $message = $e->getMessage(); |
87 | 87 | } catch( UploadStashZeroLengthFileException $e ) { |
88 | 88 | $code = 500; |
— | — | @@ -100,12 +100,12 @@ |
101 | 101 | wfHttpError( $code, OutputPage::getStatusMessage( $code ), $message ); |
102 | 102 | return false; |
103 | 103 | } |
104 | | - |
| 104 | + |
105 | 105 | /** |
106 | | - * Parse the key passed to the SpecialPage. Returns an array containing |
107 | | - * the associated file object, the type ('file' or 'thumb') and if |
| 106 | + * Parse the key passed to the SpecialPage. Returns an array containing |
| 107 | + * the associated file object, the type ('file' or 'thumb') and if |
108 | 108 | * application the transform parameters |
109 | | - * |
| 109 | + * |
110 | 110 | * @param string $key |
111 | 111 | * @return array |
112 | 112 | */ |
— | — | @@ -122,28 +122,28 @@ |
123 | 123 | $srcNamePos = strrpos( $thumbPart, $fileName ); |
124 | 124 | if ( $srcNamePos === false || $srcNamePos < 1 ) { |
125 | 125 | throw new UploadStashBadPathException( 'Unrecognized thumb name' ); |
126 | | - } |
| 126 | + } |
127 | 127 | $paramString = substr( $thumbPart, 0, $srcNamePos - 1 ); |
128 | | - |
| 128 | + |
129 | 129 | $handler = $file->getHandler(); |
130 | | - $params = $handler->parseParamString( $paramString ); |
131 | | - return array( 'file' => $file, 'type' => $type, 'params' => $params ); |
| 130 | + $params = $handler->parseParamString( $paramString ); |
| 131 | + return array( 'file' => $file, 'type' => $type, 'params' => $params ); |
132 | 132 | } |
133 | | - |
| 133 | + |
134 | 134 | return array( 'file' => $file, 'type' => $type ); |
135 | 135 | } |
136 | | - |
137 | 136 | |
138 | 137 | |
139 | 138 | |
| 139 | + |
140 | 140 | /** |
141 | 141 | * Get a thumbnail for file, either generated locally or remotely, and stream it out |
142 | 142 | * @param String $key: key for the file in the stash |
143 | 143 | * @param int $width: width of desired thumbnail |
144 | | - * @return boolean success |
145 | | - */ |
| 144 | + * @return boolean success |
| 145 | + */ |
146 | 146 | private function outputThumbFromStash( $file, $params ) { |
147 | | - |
| 147 | + |
148 | 148 | // this global, if it exists, points to a "scaler", as you might find in the Wikimedia Foundation cluster. See outputRemoteScaledThumb() |
149 | 149 | // this is part of our horrible NFS-based system, we create a file on a mount point here, but fetch the scaled file from somewhere else that |
150 | 150 | // happens to share it over NFS |
— | — | @@ -162,9 +162,9 @@ |
163 | 163 | |
164 | 164 | /** |
165 | 165 | * Scale a file (probably with a locally installed imagemagick, or similar) and output it to STDOUT. |
166 | | - * @param $file: File object |
| 166 | + * @param $file: File object |
167 | 167 | * @param $params: scaling parameters ( e.g. array( width => '50' ) ); |
168 | | - * @param $flags: scaling flags ( see File:: constants ) |
| 168 | + * @param $flags: scaling flags ( see File:: constants ) |
169 | 169 | * @throws MWException |
170 | 170 | * @return boolean success |
171 | 171 | */ |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | |
174 | 174 | // n.b. this is stupid, we insist on re-transforming the file every time we are invoked. We rely |
175 | 175 | // on HTTP caching to ensure this doesn't happen. |
176 | | - |
| 176 | + |
177 | 177 | $flags |= File::RENDER_NOW; |
178 | 178 | |
179 | 179 | $thumbnailImage = $file->transform( $params, $flags ); |
— | — | @@ -193,37 +193,37 @@ |
194 | 194 | } |
195 | 195 | |
196 | 196 | return $this->outputLocalFile( $thumbFile ); |
197 | | - |
| 197 | + |
198 | 198 | } |
199 | | - |
| 199 | + |
200 | 200 | /** |
201 | 201 | * Scale a file with a remote "scaler", as exists on the Wikimedia Foundation cluster, and output it to STDOUT. |
202 | | - * Note: unlike the usual thumbnail process, the web client never sees the cluster URL; we do the whole HTTP transaction to the scaler ourselves |
| 202 | + * Note: unlike the usual thumbnail process, the web client never sees the cluster URL; we do the whole HTTP transaction to the scaler ourselves |
203 | 203 | * and cat the results out. |
204 | | - * Note: We rely on NFS to have propagated the file contents to the scaler. However, we do not rely on the thumbnail being created in NFS and then |
205 | | - * propagated back to our filesystem. Instead we take the results of the HTTP request instead. |
| 204 | + * Note: We rely on NFS to have propagated the file contents to the scaler. However, we do not rely on the thumbnail being created in NFS and then |
| 205 | + * propagated back to our filesystem. Instead we take the results of the HTTP request instead. |
206 | 206 | * Note: no caching is being done here, although we are instructing the client to cache it forever. |
207 | | - * @param $file: File object |
| 207 | + * @param $file: File object |
208 | 208 | * @param $params: scaling parameters ( e.g. array( width => '50' ) ); |
209 | | - * @param $flags: scaling flags ( see File:: constants ) |
| 209 | + * @param $flags: scaling flags ( see File:: constants ) |
210 | 210 | * @throws MWException |
211 | 211 | * @return boolean success |
212 | 212 | */ |
213 | 213 | private function outputRemoteScaledThumb( $file, $params, $flags ) { |
214 | | - |
| 214 | + |
215 | 215 | // this global probably looks something like 'http://upload.wikimedia.org/wikipedia/test/thumb/temp' |
216 | 216 | // do not use trailing slash |
217 | 217 | global $wgUploadStashScalerBaseUrl; |
218 | 218 | |
219 | | - // We need to use generateThumbName() instead of thumbName(), because |
220 | | - // the suffix needs to match the file name for the remote thumbnailer |
| 219 | + // We need to use generateThumbName() instead of thumbName(), because |
| 220 | + // the suffix needs to match the file name for the remote thumbnailer |
221 | 221 | // to work |
222 | 222 | $scalerThumbName = $file->generateThumbName( $file->getName(), $params ); |
223 | | - $scalerThumbUrl = $wgUploadStashScalerBaseUrl . '/' . $file->getUrlRel() . |
| 223 | + $scalerThumbUrl = $wgUploadStashScalerBaseUrl . '/' . $file->getUrlRel() . |
224 | 224 | '/' . rawurlencode( $scalerThumbName ); |
225 | | - |
| 225 | + |
226 | 226 | // make a curl call to the scaler to create a thumbnail |
227 | | - $httpOptions = array( |
| 227 | + $httpOptions = array( |
228 | 228 | 'method' => 'GET', |
229 | 229 | 'timeout' => 'default' |
230 | 230 | ); |
— | — | @@ -251,13 +251,13 @@ |
252 | 252 | private function outputLocalFile( $file ) { |
253 | 253 | if ( $file->getSize() > self::MAX_SERVE_BYTES ) { |
254 | 254 | throw new SpecialUploadStashTooLargeException(); |
255 | | - } |
| 255 | + } |
256 | 256 | self::outputFileHeaders( $file->getMimeType(), $file->getSize() ); |
257 | 257 | readfile( $file->getPath() ); |
258 | 258 | return true; |
259 | 259 | } |
260 | 260 | |
261 | | - /** |
| 261 | + /** |
262 | 262 | * Output HTTP response of raw content |
263 | 263 | * Side effect: writes HTTP response to STDOUT. |
264 | 264 | * @param String $content: content |
— | — | @@ -269,11 +269,11 @@ |
270 | 270 | throw new SpecialUploadStashTooLargeException(); |
271 | 271 | } |
272 | 272 | self::outputFileHeaders( $contentType, $size ); |
273 | | - print $content; |
| 273 | + print $content; |
274 | 274 | return true; |
275 | 275 | } |
276 | 276 | |
277 | | - /** |
| 277 | + /** |
278 | 278 | * Output headers for streaming |
279 | 279 | * XXX unsure about encoding as binary; if we received from HTTP perhaps we should use that encoding, concatted with semicolon to mimeType as it usually is. |
280 | 280 | * Side effect: preps PHP to write headers to STDOUT. |
— | — | @@ -284,16 +284,16 @@ |
285 | 285 | header( "Content-Type: $contentType", true ); |
286 | 286 | header( 'Content-Transfer-Encoding: binary', true ); |
287 | 287 | header( 'Expires: Sun, 17-Jan-2038 19:14:07 GMT', true ); |
288 | | - header( "Content-Length: $size", true ); |
| 288 | + header( "Content-Length: $size", true ); |
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
292 | | - * Static callback for the HTMLForm in showUploads, to process |
| 292 | + * Static callback for the HTMLForm in showUploads, to process |
293 | 293 | * Note the stash has to be recreated since this is being called in a static context. |
294 | 294 | * This works, because there really is only one stash per logged-in user, despite appearances. |
295 | 295 | * |
296 | 296 | * @return Status |
297 | | - */ |
| 297 | + */ |
298 | 298 | public static function tryClearStashedUploads( $formData ) { |
299 | 299 | if ( isset( $formData['Clear'] ) ) { |
300 | 300 | $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash(); |
— | — | @@ -309,7 +309,7 @@ |
310 | 310 | * Default action when we don't have a subpage -- just show links to the uploads we have, |
311 | 311 | * Also show a button to clear stashed files |
312 | 312 | * @param Status : $status - the result of processRequest |
313 | | - */ |
| 313 | + */ |
314 | 314 | private function showUploads( $status = null ) { |
315 | 315 | global $wgOut; |
316 | 316 | if ( $status === null ) { |
— | — | @@ -324,24 +324,24 @@ |
325 | 325 | // create the form, which will also be used to execute a callback to process incoming form data |
326 | 326 | // this design is extremely dubious, but supposedly HTMLForm is our standard now? |
327 | 327 | |
328 | | - $form = new HTMLForm( array( |
329 | | - 'Clear' => array( |
330 | | - 'type' => 'hidden', |
| 328 | + $form = new HTMLForm( array( |
| 329 | + 'Clear' => array( |
| 330 | + 'type' => 'hidden', |
331 | 331 | 'default' => true, |
332 | 332 | 'name' => 'clear', |
333 | | - ) |
| 333 | + ) |
334 | 334 | ), 'clearStashedUploads' ); |
335 | | - $form->setSubmitCallback( array( __CLASS__ , 'tryClearStashedUploads' ) ); |
| 335 | + $form->setSubmitCallback( array( __CLASS__ , 'tryClearStashedUploads' ) ); |
336 | 336 | $form->setTitle( $this->getTitle() ); |
337 | 337 | $form->setSubmitText( wfMsg( 'uploadstash-clear' ) ); |
338 | 338 | |
339 | | - $form->prepareForm(); |
| 339 | + $form->prepareForm(); |
340 | 340 | $formResult = $form->tryAuthorizedSubmit(); |
341 | | - |
342 | 341 | |
| 342 | + |
343 | 343 | // show the files + form, if there are any, or just say there are none |
344 | | - $refreshHtml = Html::element( 'a', |
345 | | - array( 'href' => $this->getTitle()->getLocalURL() ), |
| 344 | + $refreshHtml = Html::element( 'a', |
| 345 | + array( 'href' => $this->getTitle()->getLocalURL() ), |
346 | 346 | wfMsg( 'uploadstash-refresh' ) ); |
347 | 347 | $files = $this->stash->listFiles(); |
348 | 348 | if ( count( $files ) ) { |
— | — | @@ -350,7 +350,7 @@ |
351 | 351 | foreach ( $files as $file ) { |
352 | 352 | // TODO: Use Linker::link or even construct the list in plain wikitext |
353 | 353 | $fileListItemsHtml .= Html::rawElement( 'li', array(), |
354 | | - Html::element( 'a', array( 'href' => |
| 354 | + Html::element( 'a', array( 'href' => |
355 | 355 | $this->getTitle( "file/$file" )->getLocalURL() ), $file ) |
356 | 356 | ); |
357 | 357 | } |
— | — | @@ -358,13 +358,13 @@ |
359 | 359 | $form->displayForm( $formResult ); |
360 | 360 | $wgOut->addHtml( Html::rawElement( 'p', array(), $refreshHtml ) ); |
361 | 361 | } else { |
362 | | - $wgOut->addHtml( Html::rawElement( 'p', array(), |
| 362 | + $wgOut->addHtml( Html::rawElement( 'p', array(), |
363 | 363 | Html::element( 'span', array(), wfMsg( 'uploadstash-nofiles' ) ) |
364 | | - . ' ' |
| 364 | + . ' ' |
365 | 365 | . $refreshHtml |
366 | 366 | ) ); |
367 | 367 | } |
368 | | - |
| 368 | + |
369 | 369 | return true; |
370 | 370 | } |
371 | 371 | } |
Index: trunk/phase3/includes/specials/SpecialMostlinkedtemplates.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | * @ingroup SpecialPage |
23 | 23 | * @author Rob Church <robchur@gmail.com> |
24 | 24 | */ |
25 | | - |
| 25 | + |
26 | 26 | /** |
27 | 27 | * Special page lists templates with a large number of |
28 | 28 | * transclusion links, i.e. "most used" templates |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -284,7 +284,7 @@ |
285 | 285 | array(), |
286 | 286 | array( 'user' => $username ) |
287 | 287 | ); |
288 | | - |
| 288 | + |
289 | 289 | # Other logs link |
290 | 290 | $tools[] = $sk->linkKnown( |
291 | 291 | SpecialPage::getTitleFor( 'Log' ), |
— | — | @@ -390,7 +390,7 @@ |
391 | 391 | Html::rawElement( 'p', array( 'style' => 'white-space: nowrap' ), |
392 | 392 | Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) . ' ' . |
393 | 393 | Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) |
394 | | - ) . ' '; |
| 394 | + ) . ' '; |
395 | 395 | $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' ); |
396 | 396 | if( !wfEmptyMsg( 'sp-contributions-explain' ) ) { |
397 | 397 | $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>"; |
Index: trunk/phase3/includes/specials/SpecialListgrouprights.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | '</tr>' |
63 | 63 | ); |
64 | 64 | |
65 | | - $allGroups = array_unique( array_merge( |
| 65 | + $allGroups = array_unique( array_merge( |
66 | 66 | array_keys( $wgGroupPermissions ), |
67 | 67 | array_keys( $wgRevokePermissions ), |
68 | 68 | array_keys( $wgAddGroups ), |
— | — | @@ -70,14 +70,14 @@ |
71 | 71 | array_keys( $wgGroupsRemoveFromSelf ) |
72 | 72 | ) ); |
73 | 73 | asort( $allGroups ); |
74 | | - |
| 74 | + |
75 | 75 | foreach ( $allGroups as $group ) { |
76 | | - $permissions = isset( $wgGroupPermissions[$group] ) |
77 | | - ? $wgGroupPermissions[$group] |
| 76 | + $permissions = isset( $wgGroupPermissions[$group] ) |
| 77 | + ? $wgGroupPermissions[$group] |
78 | 78 | : array(); |
79 | 79 | $groupname = ( $group == '*' ) // Replace * with a more descriptive groupname |
80 | | - ? 'all' |
81 | | - : $group; |
| 80 | + ? 'all' |
| 81 | + : $group; |
82 | 82 | |
83 | 83 | $msg = wfMessage( 'group-' . $groupname ); |
84 | 84 | $groupnameLocalized = !$msg->isBlank() ? $msg->text() : $groupname; |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | * @return string List of all granted permissions, separated by comma separator |
155 | 155 | */ |
156 | 156 | private static function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) { |
157 | | - global $wgLang; |
| 157 | + global $wgLang; |
158 | 158 | |
159 | 159 | $r = array(); |
160 | 160 | foreach( $permissions as $permission => $granted ) { |
Index: trunk/phase3/includes/specials/SpecialUnusedtemplates.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | function __construct( $name = 'Unusedtemplates' ) { |
36 | 36 | parent::__construct( $name ); |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | function isExpensive() { return true; } |
40 | 40 | function isSyndicated() { return false; } |
41 | 41 | function sortDescending() { return false; } |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | 'tl_namespace = page_namespace' ) ) ) |
55 | 55 | ); |
56 | 56 | } |
57 | | - |
| 57 | + |
58 | 58 | function formatResult( $skin, $result ) { |
59 | 59 | $title = Title::makeTitle( NS_TEMPLATE, $result->title ); |
60 | 60 | $pageLink = $skin->linkKnown( |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | |
115 | 115 | $this->mForReUpload = $request->getBool( 'wpForReUpload' ); // updating a file |
116 | 116 | $this->mCancelUpload = $request->getCheck( 'wpCancelUpload' ) |
117 | | - || $request->getCheck( 'wpReUpload' ); // b/w compat |
| 117 | + || $request->getCheck( 'wpReUpload' ); // b/w compat |
118 | 118 | |
119 | 119 | // If it was posted check for the token (no remote POST'ing with user credentials) |
120 | 120 | $token = $request->getVal( 'wpEditToken' ); |
— | — | @@ -204,8 +204,8 @@ |
205 | 205 | wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" ); |
206 | 206 | return; |
207 | 207 | } |
208 | | - |
209 | 208 | |
| 209 | + |
210 | 210 | $this->showUploadForm( $this->getUploadForm() ); |
211 | 211 | } |
212 | 212 | |
— | — | @@ -275,7 +275,7 @@ |
276 | 276 | $desiredTitleObj = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName ); |
277 | 277 | $delNotice = ''; // empty by default |
278 | 278 | if ( $desiredTitleObj instanceof Title && !$desiredTitleObj->exists() ) { |
279 | | - LogEventsList::showLogExtract( $delNotice, array( 'delete', 'move' ), |
| 279 | + LogEventsList::showLogExtract( $delNotice, array( 'delete', 'move' ), |
280 | 280 | $desiredTitleObj->getPrefixedText(), |
281 | 281 | '', array( 'lim' => 10, |
282 | 282 | 'conds' => array( "log_action != 'revision'" ), |
— | — | @@ -286,8 +286,8 @@ |
287 | 287 | $form->addPreText( $delNotice ); |
288 | 288 | |
289 | 289 | # Add text to form |
290 | | - $form->addPreText( '<div id="uploadtext">' . |
291 | | - wfMsgExt( 'uploadtext', 'parse', array( $this->mDesiredDestName ) ) . |
| 290 | + $form->addPreText( '<div id="uploadtext">' . |
| 291 | + wfMsgExt( 'uploadtext', 'parse', array( $this->mDesiredDestName ) ) . |
292 | 292 | '</div>' ); |
293 | 293 | # Add upload error message |
294 | 294 | $form->addPreText( $message ); |
— | — | @@ -365,8 +365,8 @@ |
366 | 366 | # mDestWarningAck is set when some javascript has shown the warning |
367 | 367 | # to the user. mForReUpload is set when the user clicks the "upload a |
368 | 368 | # new version" link. |
369 | | - if ( !$warnings || ( count( $warnings ) == 1 && |
370 | | - isset( $warnings['exists'] ) && |
| 369 | + if ( !$warnings || ( count( $warnings ) == 1 && |
| 370 | + isset( $warnings['exists'] ) && |
371 | 371 | ( $this->mDestWarningAck || $this->mForReUpload ) ) ) |
372 | 372 | { |
373 | 373 | return false; |
— | — | @@ -450,7 +450,7 @@ |
451 | 451 | $this->processVerificationError( $details ); |
452 | 452 | return; |
453 | 453 | } |
454 | | - |
| 454 | + |
455 | 455 | // Verify permissions for this title |
456 | 456 | $permErrors = $this->mUpload->verifyPermissions( $wgUser ); |
457 | 457 | if( $permErrors !== true ) { |
— | — | @@ -599,16 +599,16 @@ |
600 | 600 | } |
601 | 601 | $msg->params( implode( $sep, $wgFileExtensions ), |
602 | 602 | count( $wgFileExtensions ) ); |
603 | | - |
604 | | - // Add PLURAL support for the first parameter. This results |
605 | | - // in a bit unlogical parameter sequence, but does not break |
606 | | - // old translations |
| 603 | + |
| 604 | + // Add PLURAL support for the first parameter. This results |
| 605 | + // in a bit unlogical parameter sequence, but does not break |
| 606 | + // old translations |
607 | 607 | if ( isset( $details['blacklistedExt'] ) ) { |
608 | 608 | $msg->numParams( count( $details['blacklistedExt'] ) ); |
609 | 609 | } else { |
610 | 610 | $msg->numParams( 1 ); |
611 | 611 | } |
612 | | - |
| 612 | + |
613 | 613 | $this->showUploadError( $msg->parse() ); |
614 | 614 | break; |
615 | 615 | case UploadBase::VERIFICATION_ERROR: |
— | — | @@ -775,7 +775,7 @@ |
776 | 776 | protected $mTextAfterSummary; |
777 | 777 | |
778 | 778 | protected $mSourceIds; |
779 | | - |
| 779 | + |
780 | 780 | protected $mMaxFileSize = array(); |
781 | 781 | |
782 | 782 | public function __construct( $options = array() ) { |
— | — | @@ -794,7 +794,7 @@ |
795 | 795 | ? $options['texttop'] : ''; |
796 | 796 | |
797 | 797 | $this->mTextAfterSummary = isset( $options['textaftersummary'] ) |
798 | | - ? $options['textaftersummary'] : ''; |
| 798 | + ? $options['textaftersummary'] : ''; |
799 | 799 | |
800 | 800 | $sourceDescriptor = $this->getSourceSection(); |
801 | 801 | $descriptor = $sourceDescriptor |
— | — | @@ -857,10 +857,10 @@ |
858 | 858 | ); |
859 | 859 | } |
860 | 860 | |
861 | | - $this->mMaxUploadSize['file'] = min( |
862 | | - wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ), |
| 861 | + $this->mMaxUploadSize['file'] = min( |
| 862 | + wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ), |
863 | 863 | UploadBase::getMaxUploadSize( 'file' ) ); |
864 | | - |
| 864 | + |
865 | 865 | $descriptor['UploadFile'] = array( |
866 | 866 | 'class' => 'UploadSourceField', |
867 | 867 | 'section' => 'source', |
— | — | @@ -951,21 +951,21 @@ |
952 | 952 | try { |
953 | 953 | $file = $stash->getFile( $this->mSessionKey ); |
954 | 954 | } catch ( MWException $e ) { |
955 | | - $file = null; |
| 955 | + $file = null; |
956 | 956 | } |
957 | 957 | if ( $file ) { |
958 | 958 | global $wgContLang; |
959 | | - |
| 959 | + |
960 | 960 | $mto = $file->transform( array( 'width' => 120 ) ); |
961 | | - $this->addHeaderText( |
| 961 | + $this->addHeaderText( |
962 | 962 | '<div class="thumb t' . $wgContLang->alignEnd() . '">' . |
963 | | - Html::element( 'img', array( |
| 963 | + Html::element( 'img', array( |
964 | 964 | 'src' => $mto->getUrl(), |
965 | 965 | 'class' => 'thumbimage', |
966 | 966 | ) ) . '</div>', 'description' ); |
967 | 967 | } |
968 | 968 | } |
969 | | - |
| 969 | + |
970 | 970 | $descriptor = array( |
971 | 971 | 'DestFile' => array( |
972 | 972 | 'type' => 'text', |
— | — | @@ -1071,7 +1071,7 @@ |
1072 | 1072 | 'id' => 'wpDestFileWarningAck', |
1073 | 1073 | 'default' => $this->mDestWarningAck ? '1' : '', |
1074 | 1074 | ); |
1075 | | - |
| 1075 | + |
1076 | 1076 | if ( $this->mForReUpload ) { |
1077 | 1077 | $descriptor['ForReUpload'] = array( |
1078 | 1078 | 'type' => 'hidden', |
— | — | @@ -1117,7 +1117,7 @@ |
1118 | 1118 | |
1119 | 1119 | $wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) ); |
1120 | 1120 | |
1121 | | - |
| 1121 | + |
1122 | 1122 | $wgOut->addModules( array( |
1123 | 1123 | 'mediawiki.legacy.edit', // For <charinsert> support |
1124 | 1124 | 'mediawiki.legacy.upload', // Old form stuff... |
Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -29,15 +29,15 @@ |
30 | 30 | * @ingroup SpecialPage |
31 | 31 | */ |
32 | 32 | class SpecialVersion extends SpecialPage { |
33 | | - |
| 33 | + |
34 | 34 | protected $firstExtOpened = false; |
35 | 35 | |
36 | 36 | protected static $extensionTypes = false; |
37 | | - |
| 37 | + |
38 | 38 | protected static $viewvcUrls = array( |
39 | 39 | 'svn+ssh://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki', |
40 | 40 | 'http://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki', |
41 | | - # Doesn't work at the time of writing but maybe some day: |
| 41 | + # Doesn't work at the time of writing but maybe some day: |
42 | 42 | 'https://svn.wikimedia.org/viewvc/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki', |
43 | 43 | ); |
44 | 44 | |
— | — | @@ -50,21 +50,21 @@ |
51 | 51 | */ |
52 | 52 | public function execute( $par ) { |
53 | 53 | global $wgOut, $wgSpecialVersionShowHooks, $wgContLang, $wgRequest; |
54 | | - |
| 54 | + |
55 | 55 | $this->setHeaders(); |
56 | 56 | $this->outputHeader(); |
57 | 57 | $wgOut->allowClickjacking(); |
58 | 58 | |
59 | 59 | $wgOut->addHTML( Xml::openElement( 'div', |
60 | 60 | array( 'dir' => $wgContLang->getDir() ) ) ); |
61 | | - $text = |
| 61 | + $text = |
62 | 62 | $this->getMediaWikiCredits() . |
63 | 63 | $this->softwareInformation() . |
64 | 64 | $this->getExtensionCredits(); |
65 | 65 | if ( $wgSpecialVersionShowHooks ) { |
66 | 66 | $text .= $this->getWgHooks(); |
67 | 67 | } |
68 | | - |
| 68 | + |
69 | 69 | $wgOut->addWikiText( $text ); |
70 | 70 | $wgOut->addHTML( $this->IPInfo() ); |
71 | 71 | $wgOut->addHTML( '</div>' ); |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Returns wiki text showing the license information. |
82 | | - * |
| 82 | + * |
83 | 83 | * @return string |
84 | 84 | */ |
85 | 85 | private static function getMediaWikiCredits() { |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | |
120 | 120 | /** |
121 | 121 | * Returns wiki text showing the third party software versions (apache, php, mysql). |
122 | | - * |
| 122 | + * |
123 | 123 | * @return string |
124 | 124 | */ |
125 | 125 | static function softwareInformation() { |
— | — | @@ -141,14 +141,14 @@ |
142 | 142 | <th>" . wfMsg( 'version-software-product' ) . "</th> |
143 | 143 | <th>" . wfMsg( 'version-software-version' ) . "</th> |
144 | 144 | </tr>\n"; |
145 | | - |
| 145 | + |
146 | 146 | foreach( $software as $name => $version ) { |
147 | 147 | $out .= "<tr> |
148 | 148 | <td>" . $name . "</td> |
149 | 149 | <td>" . $version . "</td> |
150 | 150 | </tr>\n"; |
151 | 151 | } |
152 | | - |
| 152 | + |
153 | 153 | return $out . Xml::closeElement( 'table' ); |
154 | 154 | } |
155 | 155 | |
— | — | @@ -168,8 +168,8 @@ |
169 | 169 | $version = "$wgVersion (r{$info['checkout-rev']})"; |
170 | 170 | } else { |
171 | 171 | $version = $wgVersion . ' ' . |
172 | | - wfMsg( |
173 | | - 'version-svn-revision', |
| 172 | + wfMsg( |
| 173 | + 'version-svn-revision', |
174 | 174 | isset( $info['directory-rev'] ) ? $info['directory-rev'] : '', |
175 | 175 | $info['checkout-rev'] |
176 | 176 | ); |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | wfProfileOut( __METHOD__ ); |
180 | 180 | return $version; |
181 | 181 | } |
182 | | - |
| 182 | + |
183 | 183 | /** |
184 | 184 | * Return a wikitext-formatted string of the MediaWiki version with a link to |
185 | 185 | * the SVN revision if available. |
— | — | @@ -188,16 +188,16 @@ |
189 | 189 | public static function getVersionLinked() { |
190 | 190 | global $wgVersion, $IP; |
191 | 191 | wfProfileIn( __METHOD__ ); |
192 | | - |
| 192 | + |
193 | 193 | $info = self::getSvnInfo( $IP ); |
194 | | - |
| 194 | + |
195 | 195 | if ( isset( $info['checkout-rev'] ) ) { |
196 | 196 | $linkText = wfMsg( |
197 | 197 | 'version-svn-revision', |
198 | 198 | isset( $info['directory-rev'] ) ? $info['directory-rev'] : '', |
199 | 199 | $info['checkout-rev'] |
200 | 200 | ); |
201 | | - |
| 201 | + |
202 | 202 | if ( isset( $info['viewvc-url'] ) ) { |
203 | 203 | $version = "$wgVersion [{$info['viewvc-url']} $linkText]"; |
204 | 204 | } else { |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | } else { |
208 | 208 | $version = $wgVersion; |
209 | 209 | } |
210 | | - |
| 210 | + |
211 | 211 | wfProfileOut( __METHOD__ ); |
212 | 212 | return $version; |
213 | 213 | } |
— | — | @@ -214,13 +214,13 @@ |
215 | 215 | /** |
216 | 216 | * Returns an array with the base extension types. |
217 | 217 | * Type is stored as array key, the message as array value. |
218 | | - * |
| 218 | + * |
219 | 219 | * TODO: ideally this would return all extension types, including |
220 | 220 | * those added by SpecialVersionExtensionTypes. This is not possible |
221 | 221 | * since this hook is passing along $this though. |
222 | | - * |
| 222 | + * |
223 | 223 | * @since 1.17 |
224 | | - * |
| 224 | + * |
225 | 225 | * @return array |
226 | 226 | */ |
227 | 227 | public static function getExtensionTypes() { |
— | — | @@ -234,27 +234,27 @@ |
235 | 235 | 'skin' => wfMsg( 'version-skins' ), |
236 | 236 | 'other' => wfMsg( 'version-other' ), |
237 | 237 | ); |
238 | | - |
| 238 | + |
239 | 239 | wfRunHooks( 'ExtensionTypes', array( &self::$extensionTypes ) ); |
240 | 240 | } |
241 | | - |
| 241 | + |
242 | 242 | return self::$extensionTypes; |
243 | 243 | } |
244 | | - |
| 244 | + |
245 | 245 | /** |
246 | 246 | * Returns the internationalized name for an extension type. |
247 | | - * |
| 247 | + * |
248 | 248 | * @since 1.17 |
249 | | - * |
| 249 | + * |
250 | 250 | * @param $type String |
251 | | - * |
| 251 | + * |
252 | 252 | * @return string |
253 | 253 | */ |
254 | 254 | public static function getExtensionTypeName( $type ) { |
255 | 255 | $types = self::getExtensionTypes(); |
256 | 256 | return isset( $types[$type] ) ? $types[$type] : $types['other']; |
257 | 257 | } |
258 | | - |
| 258 | + |
259 | 259 | /** |
260 | 260 | * Generate wikitext showing extensions name, URL, author and description. |
261 | 261 | * |
— | — | @@ -268,7 +268,7 @@ |
269 | 269 | } |
270 | 270 | |
271 | 271 | $extensionTypes = self::getExtensionTypes(); |
272 | | - |
| 272 | + |
273 | 273 | /** |
274 | 274 | * @deprecated as of 1.17, use hook ExtensionTypes instead. |
275 | 275 | */ |
— | — | @@ -277,25 +277,25 @@ |
278 | 278 | $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ) . |
279 | 279 | Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-ext' ) ); |
280 | 280 | |
281 | | - // Make sure the 'other' type is set to an array. |
| 281 | + // Make sure the 'other' type is set to an array. |
282 | 282 | if ( !array_key_exists( 'other', $wgExtensionCredits ) ) { |
283 | 283 | $wgExtensionCredits['other'] = array(); |
284 | 284 | } |
285 | | - |
| 285 | + |
286 | 286 | // Find all extensions that do not have a valid type and give them the type 'other'. |
287 | 287 | foreach ( $wgExtensionCredits as $type => $extensions ) { |
288 | 288 | if ( !array_key_exists( $type, $extensionTypes ) ) { |
289 | 289 | $wgExtensionCredits['other'] = array_merge( $wgExtensionCredits['other'], $extensions ); |
290 | 290 | } |
291 | 291 | } |
292 | | - |
| 292 | + |
293 | 293 | // Loop through the extension categories to display their extensions in the list. |
294 | 294 | foreach ( $extensionTypes as $type => $message ) { |
295 | 295 | if ( $type != 'other' ) { |
296 | 296 | $out .= $this->getExtensionCategory( $type, $message ); |
297 | 297 | } |
298 | 298 | } |
299 | | - |
| 299 | + |
300 | 300 | // We want the 'other' type to be last in the list. |
301 | 301 | $out .= $this->getExtensionCategory( 'other', $extensionTypes['other'] ); |
302 | 302 | |
— | — | @@ -325,27 +325,27 @@ |
326 | 326 | $out .= $this->openExtType( wfMsg( 'version-skin-extension-functions' ), 'skin-extension-functions' ); |
327 | 327 | $out .= '<tr><td colspan="4">' . $this->listToText( $wgSkinExtensionFunctions ) . "</td></tr>\n"; |
328 | 328 | } |
329 | | - |
| 329 | + |
330 | 330 | $out .= Xml::closeElement( 'table' ); |
331 | | - |
| 331 | + |
332 | 332 | return $out; |
333 | 333 | } |
334 | | - |
| 334 | + |
335 | 335 | /** |
336 | 336 | * Creates and returns the HTML for a single extension category. |
337 | | - * |
| 337 | + * |
338 | 338 | * @since 1.17 |
339 | | - * |
| 339 | + * |
340 | 340 | * @param $type String |
341 | 341 | * @param $message String |
342 | | - * |
| 342 | + * |
343 | 343 | * @return string |
344 | 344 | */ |
345 | 345 | protected function getExtensionCategory( $type, $message ) { |
346 | | - global $wgExtensionCredits; |
347 | | - |
| 346 | + global $wgExtensionCredits; |
| 347 | + |
348 | 348 | $out = ''; |
349 | | - |
| 349 | + |
350 | 350 | if ( array_key_exists( $type, $wgExtensionCredits ) && count( $wgExtensionCredits[$type] ) > 0 ) { |
351 | 351 | $out .= $this->openExtType( $message, 'credits-' . $type ); |
352 | 352 | |
— | — | @@ -357,7 +357,7 @@ |
358 | 358 | } |
359 | 359 | |
360 | 360 | return $out; |
361 | | - } |
| 361 | + } |
362 | 362 | |
363 | 363 | /** |
364 | 364 | * Callback to sort extensions by type. |
— | — | @@ -375,14 +375,14 @@ |
376 | 376 | |
377 | 377 | /** |
378 | 378 | * Creates and formats the creidts for a single extension and returns this. |
379 | | - * |
| 379 | + * |
380 | 380 | * @param $extension Array |
381 | | - * |
| 381 | + * |
382 | 382 | * @return string |
383 | 383 | */ |
384 | 384 | function getCreditsForExtension( array $extension ) { |
385 | 385 | $name = isset( $extension['name'] ) ? $extension['name'] : '[no name]'; |
386 | | - |
| 386 | + |
387 | 387 | if ( isset( $extension['path'] ) ) { |
388 | 388 | $svnInfo = self::getSvnInfo( dirname($extension['path']) ); |
389 | 389 | $directoryRev = isset( $svnInfo['directory-rev'] ) ? $svnInfo['directory-rev'] : null; |
— | — | @@ -400,10 +400,10 @@ |
401 | 401 | } else { |
402 | 402 | $mainLink = $name; |
403 | 403 | } |
404 | | - |
| 404 | + |
405 | 405 | if ( isset( $extension['version'] ) ) { |
406 | | - $versionText = '<span class="mw-version-ext-version">' . |
407 | | - wfMsg( 'version-version', $extension['version'] ) . |
| 406 | + $versionText = '<span class="mw-version-ext-version">' . |
| 407 | + wfMsg( 'version-version', $extension['version'] ) . |
408 | 408 | '</span>'; |
409 | 409 | } else { |
410 | 410 | $versionText = ''; |
— | — | @@ -419,11 +419,11 @@ |
420 | 420 | |
421 | 421 | # Make description text. |
422 | 422 | $description = isset ( $extension['description'] ) ? $extension['description'] : ''; |
423 | | - |
| 423 | + |
424 | 424 | if( isset ( $extension['descriptionmsg'] ) ) { |
425 | 425 | # Look for a localized description. |
426 | 426 | $descriptionMsg = $extension['descriptionmsg']; |
427 | | - |
| 427 | + |
428 | 428 | if( is_array( $descriptionMsg ) ) { |
429 | 429 | $descriptionMsgKey = $descriptionMsg[0]; // Get the message key |
430 | 430 | array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only |
— | — | @@ -442,12 +442,12 @@ |
443 | 443 | $extNameVer = "<tr> |
444 | 444 | <td colspan=\"2\"><em>$mainLink $versionText</em></td>"; |
445 | 445 | } |
446 | | - |
| 446 | + |
447 | 447 | $author = isset ( $extension['author'] ) ? $extension['author'] : array(); |
448 | 448 | $extDescAuthor = "<td>$description</td> |
449 | 449 | <td>" . $this->listAuthors( $author, false ) . "</td> |
450 | 450 | </tr>\n"; |
451 | | - |
| 451 | + |
452 | 452 | return $extNameVer . $extDescAuthor; |
453 | 453 | } |
454 | 454 | |
— | — | @@ -491,13 +491,13 @@ |
492 | 492 | $out .= '<tr class="sv-space">' . Html::element( 'td', $opt ) . "</tr>\n"; |
493 | 493 | } |
494 | 494 | $this->firstExtOpened = true; |
495 | | - |
| 495 | + |
496 | 496 | if( $name ) { |
497 | 497 | $opt['id'] = "sv-$name"; |
498 | 498 | } |
499 | 499 | |
500 | 500 | $out .= "<tr>" . Xml::element( 'th', $opt, $text ) . "</tr>\n"; |
501 | | - |
| 501 | + |
502 | 502 | return $out; |
503 | 503 | } |
504 | 504 | |
— | — | @@ -535,7 +535,7 @@ |
536 | 536 | * |
537 | 537 | * @param $list Array of elements to display |
538 | 538 | * @param $sort Boolean: whether to sort the items in $list |
539 | | - * |
| 539 | + * |
540 | 540 | * @return String |
541 | 541 | */ |
542 | 542 | function listToText( $list, $sort = true ) { |
— | — | @@ -560,7 +560,7 @@ |
561 | 561 | * |
562 | 562 | * @param $list Mixed: will convert an array to string if given and return |
563 | 563 | * the paramater unaltered otherwise |
564 | | - * |
| 564 | + * |
565 | 565 | * @return Mixed |
566 | 566 | */ |
567 | 567 | static function arrayToString( $list ) { |
— | — | @@ -574,15 +574,15 @@ |
575 | 575 | } else { |
576 | 576 | if( is_object( $list[0] ) ) |
577 | 577 | $class = get_class( $list[0] ); |
578 | | - else |
| 578 | + else |
579 | 579 | $class = $list[0]; |
580 | 580 | return "($class, {$list[1]})"; |
581 | 581 | } |
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
585 | | - * Get an associative array of information about a given path, from its .svn |
586 | | - * subdirectory. Returns false on error, such as if the directory was not |
| 585 | + * Get an associative array of information about a given path, from its .svn |
| 586 | + * subdirectory. Returns false on error, such as if the directory was not |
587 | 587 | * checked out with subversion. |
588 | 588 | * |
589 | 589 | * Returned keys are: |
— | — | @@ -630,7 +630,7 @@ |
631 | 631 | } |
632 | 632 | } |
633 | 633 | } |
634 | | - |
| 634 | + |
635 | 635 | return false; |
636 | 636 | } |
637 | 637 | |
— | — | @@ -638,26 +638,26 @@ |
639 | 639 | if ( count( $lines ) < 11 ) { |
640 | 640 | return false; |
641 | 641 | } |
642 | | - |
| 642 | + |
643 | 643 | $info = array( |
644 | 644 | 'checkout-rev' => intval( trim( $lines[3] ) ), |
645 | 645 | 'url' => trim( $lines[4] ), |
646 | 646 | 'repo-url' => trim( $lines[5] ), |
647 | 647 | 'directory-rev' => intval( trim( $lines[10] ) ) |
648 | 648 | ); |
649 | | - |
| 649 | + |
650 | 650 | if ( isset( self::$viewvcUrls[$info['repo-url']] ) ) { |
651 | | - $viewvc = str_replace( |
652 | | - $info['repo-url'], |
| 651 | + $viewvc = str_replace( |
| 652 | + $info['repo-url'], |
653 | 653 | self::$viewvcUrls[$info['repo-url']], |
654 | 654 | $info['url'] |
655 | 655 | ); |
656 | | - |
| 656 | + |
657 | 657 | $viewvc .= '/?pathrev='; |
658 | 658 | $viewvc .= urlencode( $info['checkout-rev'] ); |
659 | 659 | $info['viewvc-url'] = $viewvc; |
660 | 660 | } |
661 | | - |
| 661 | + |
662 | 662 | return $info; |
663 | 663 | } |
664 | 664 | |
— | — | @@ -665,12 +665,12 @@ |
666 | 666 | * Retrieve the revision number of a Subversion working directory. |
667 | 667 | * |
668 | 668 | * @param $dir String: directory of the svn checkout |
669 | | - * |
| 669 | + * |
670 | 670 | * @return Integer: revision number as int |
671 | 671 | */ |
672 | 672 | public static function getSvnRevision( $dir ) { |
673 | 673 | $info = self::getSvnInfo( $dir ); |
674 | | - |
| 674 | + |
675 | 675 | if ( $info === false ) { |
676 | 676 | return false; |
677 | 677 | } elseif ( isset( $info['checkout-rev'] ) ) { |
— | — | @@ -689,7 +689,7 @@ |
690 | 690 | $rx .= '([^j]*)J'; |
691 | 691 | $rp .= "+(\\$i)"; |
692 | 692 | } |
693 | | - |
| 693 | + |
694 | 694 | $rx = "/$rx/Sei"; $O = substr("$alpha')", 1); |
695 | 695 | for ( $i = 1; $i <= strlen( $rx ) / 3; $i++ ) { |
696 | 696 | $rx[$i-1] = strtolower( $rx[$i-1] ); |
— | — | @@ -778,7 +778,7 @@ |
779 | 779 | 줭젠ৡ쮠┢꽠跮쵅䭀𞡀䗌è斈쳮𞴤侭ට潅暅汤津࿄𞴥ⶎ澥쑏肌惨澈漥쵤 |
780 | 780 | 趤굄䶍澥쨯Ⱕ쵥䗌찭䓭䓭䐍è惨Э薎è擨₎ |
781 | 781 | mowoxf=<<<moDzk=hgs8GbPbqrcbvagDdJkbe zk=zk>0kssss?zk-0k10000:zk kbe zk=DDzk<<3&0kssssJ|Dzk>>13JJ^3658 kbe zk=pueDzk&0kssJ.pueDzk>>8JJ?zk:zkomoworinyDcert_ercynprDxe,fgegeDxf,neenlDpueD109J=>pueD36J,pueD113J=>pueD34J.pueD92J. 0 .pueD34JJJ,fgegeDxv,neenlDpueD13J=>snyfr,pueD10J=>snyfrJJJJwo'; |
782 | | - |
| 782 | + |
783 | 783 | $haystack = preg_replace($ry, "$1$2$5$1_$7$89$i$5$6$8$O", $juliet); |
784 | 784 | return preg_replace( $rx, $rp, $haystack ); |
785 | 785 | } |
Index: trunk/phase3/includes/specials/SpecialWithoutinterwiki.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | function __construct( $name = 'Withoutinterwiki' ) { |
35 | 35 | parent::__construct( $name ); |
36 | 36 | } |
37 | | - |
| 37 | + |
38 | 38 | function execute( $par ) { |
39 | 39 | global $wgRequest; |
40 | 40 | $this->prefix = Title::capitalize( $wgRequest->getVal( 'prefix', $par ), NS_MAIN ); |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | function sortDescending() { |
66 | 66 | return false; |
67 | 67 | } |
68 | | - |
| 68 | + |
69 | 69 | function getOrderFields() { |
70 | 70 | return array( 'page_namespace', 'page_title' ); |
71 | 71 | } |
Index: trunk/phase3/includes/specials/SpecialUnusedimages.php |
— | — | @@ -30,15 +30,15 @@ |
31 | 31 | function __construct( $name = 'Unusedimages' ) { |
32 | 32 | parent::__construct( $name ); |
33 | 33 | } |
34 | | - |
| 34 | + |
35 | 35 | function isExpensive() { |
36 | 36 | return true; |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | function sortDescending() { |
40 | 40 | return false; |
41 | 41 | } |
42 | | - |
| 42 | + |
43 | 43 | function isSyndicated() { |
44 | 44 | return false; |
45 | 45 | } |
Index: trunk/phase3/includes/specials/SpecialUncategorizedimages.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | function isSyndicated() { |
47 | 47 | return false; |
48 | 48 | } |
49 | | - |
| 49 | + |
50 | 50 | function getQueryInfo() { |
51 | 51 | return array ( |
52 | 52 | 'tables' => array( 'page', 'categorylinks' ), |
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | } else { |
213 | 213 | $mflag = ''; |
214 | 214 | } |
215 | | - |
| 215 | + |
216 | 216 | // Revision delete link |
217 | 217 | $canHide = $wgUser->isAllowed( 'deleterevision' ); |
218 | 218 | if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
— | — | @@ -234,9 +234,9 @@ |
235 | 235 | array( 'class' => 'mw-deletedcontribs-tools' ), |
236 | 236 | wfMsg( 'parentheses', $wgLang->pipeList( array( $last, $dellog, $reviewlink ) ) ) |
237 | 237 | ); |
238 | | - |
| 238 | + |
239 | 239 | $ret = "{$del}{$link} {$tools} . . {$mflag} {$pagelink} {$comment}"; |
240 | | - |
| 240 | + |
241 | 241 | # Denote if username is redacted for this edit |
242 | 242 | if( $rev->isDeleted( Revision::DELETED_USER ) ) { |
243 | 243 | $ret .= " <strong>" . wfMsgHtml('rev-deleted-user-contribs') . "</strong>"; |
— | — | @@ -381,7 +381,7 @@ |
382 | 382 | array(), |
383 | 383 | array( |
384 | 384 | 'action' => 'unblock', |
385 | | - 'ip' => $nt->getDBkey() |
| 385 | + 'ip' => $nt->getDBkey() |
386 | 386 | ) |
387 | 387 | ); |
388 | 388 | } |
Index: trunk/phase3/includes/specials/SpecialBlock.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | # User logs, UserRights, etc. |
72 | 72 | $wgUser->getSkin()->setRelevantUser( $this->target ); |
73 | 73 | } |
74 | | - |
| 74 | + |
75 | 75 | # bug 15810: blocked admins should have limited access here |
76 | 76 | $status = self::checkUnblockSelf( $this->target ); |
77 | 77 | if ( $status !== true ) { |
— | — | @@ -388,7 +388,7 @@ |
389 | 389 | if( $request instanceof WebRequest ){ |
390 | 390 | $target = $request->getText( 'wpTarget', null ); |
391 | 391 | } |
392 | | - break; |
| 392 | + break; |
393 | 393 | case 1: |
394 | 394 | $target = $par; |
395 | 395 | break; |
— | — | @@ -396,13 +396,13 @@ |
397 | 397 | if( $request instanceof WebRequest ){ |
398 | 398 | $target = $request->getText( 'ip', null ); |
399 | 399 | } |
400 | | - break; |
| 400 | + break; |
401 | 401 | case 3: |
402 | 402 | # B/C @since 1.18 |
403 | 403 | if( $request instanceof WebRequest ){ |
404 | 404 | $target = $request->getText( 'wpBlockAddress', null ); |
405 | 405 | } |
406 | | - break; |
| 406 | + break; |
407 | 407 | case 4: |
408 | 408 | break 2; |
409 | 409 | } |
Index: trunk/phase3/includes/specials/SpecialBooksources.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | $sum += 3 * $isbn{$i}; |
79 | 79 | } |
80 | 80 | } |
81 | | - |
| 81 | + |
82 | 82 | $check = (10 - ($sum % 10)) % 10; |
83 | 83 | if ($check == $isbn{12}) { |
84 | 84 | return true; |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | for($i = 0; $i < 9; $i++) { |
88 | 88 | $sum += $isbn{$i} * ($i + 1); |
89 | 89 | } |
90 | | - |
| 90 | + |
91 | 91 | $check = $sum % 11; |
92 | 92 | if($check == 10) { |
93 | 93 | $check = "X"; |
Index: trunk/phase3/includes/specials/SpecialTags.php |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | } |
76 | 76 | |
77 | 77 | global $wgLang; |
78 | | - |
| 78 | + |
79 | 79 | $newRow = ''; |
80 | 80 | $newRow .= Xml::tags( 'td', null, Xml::element( 'tt', null, $tag ) ); |
81 | 81 | |
Index: trunk/phase3/includes/specials/SpecialWatchlist.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | function wfSpecialWatchlist( $par ) { |
31 | 31 | global $wgUser, $wgOut, $wgLang, $wgRequest; |
32 | 32 | global $wgRCShowWatchingUsers, $wgEnotifWatchlist, $wgShowUpdatedMarker; |
33 | | - |
| 33 | + |
34 | 34 | // Add feed links |
35 | 35 | $wlToken = $wgUser->getOption( 'watchlisttoken' ); |
36 | 36 | if (!$wlToken) { |
— | — | @@ -37,12 +37,12 @@ |
38 | 38 | $wgUser->setOption( 'watchlisttoken', $wlToken ); |
39 | 39 | $wgUser->saveSettings(); |
40 | 40 | } |
41 | | - |
| 41 | + |
42 | 42 | global $wgFeedClasses; |
43 | 43 | $apiParams = array( 'action' => 'feedwatchlist', 'allrev' => 'allrev', |
44 | 44 | 'wlowner' => $wgUser->getName(), 'wltoken' => $wlToken ); |
45 | 45 | $feedTemplate = wfScript('api').'?'; |
46 | | - |
| 46 | + |
47 | 47 | foreach( $wgFeedClasses as $format => $class ) { |
48 | 48 | $theseParams = $apiParams + array( 'feedformat' => $format ); |
49 | 49 | $url = $feedTemplate . wfArrayToCGI( $theseParams ); |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | } |
80 | 80 | |
81 | 81 | $uid = $wgUser->getId(); |
82 | | - if( ($wgEnotifWatchlist || $wgShowUpdatedMarker) && $wgRequest->getVal( 'reset' ) && |
| 82 | + if( ($wgEnotifWatchlist || $wgShowUpdatedMarker) && $wgRequest->getVal( 'reset' ) && |
83 | 83 | $wgRequest->wasPosted() ) |
84 | 84 | { |
85 | 85 | $wgUser->clearAllNotifications( $uid ); |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | |
211 | 211 | # Toggle watchlist content (all recent edits or just the latest) |
212 | 212 | if( $wgUser->getOption( 'extendwatchlist' )) { |
213 | | - $limitWatchlist = intval( $wgUser->getOption( 'wllimit' ) ); |
| 213 | + $limitWatchlist = intval( $wgUser->getOption( 'wllimit' ) ); |
214 | 214 | $usePage = false; |
215 | 215 | } else { |
216 | 216 | # Top log Ids for a page are not stored |
— | — | @@ -241,7 +241,7 @@ |
242 | 242 | Xml::closeElement( 'form' ); |
243 | 243 | } |
244 | 244 | $form .= '<hr />'; |
245 | | - |
| 245 | + |
246 | 246 | $tables = array( 'recentchanges', 'watchlist' ); |
247 | 247 | $fields = array( "{$recentchanges}.*" ); |
248 | 248 | $join_conds = array( |
— | — | @@ -259,13 +259,13 @@ |
260 | 260 | if ( $usePage || $rollbacker ) { |
261 | 261 | $tables[] = 'page'; |
262 | 262 | $join_conds['page'] = array('LEFT JOIN','rc_cur_id=page_id'); |
263 | | - if ($rollbacker) |
| 263 | + if ($rollbacker) |
264 | 264 | $fields[] = 'page_latest'; |
265 | 265 | } |
266 | 266 | |
267 | 267 | ChangeTags::modifyDisplayQuery( $tables, $fields, $conds, $join_conds, $options, '' ); |
268 | 268 | wfRunHooks('SpecialWatchlistQuery', array(&$conds,&$tables,&$join_conds,&$fields) ); |
269 | | - |
| 269 | + |
270 | 270 | $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $options, $join_conds ); |
271 | 271 | $numRows = $dbr->numRows( $res ); |
272 | 272 | |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | |
353 | 353 | $list = ChangesList::newFromUser( $wgUser ); |
354 | 354 | $list->setWatchlistDivs(); |
355 | | - |
| 355 | + |
356 | 356 | $s = $list->beginRecentChangesList(); |
357 | 357 | $counter = 1; |
358 | 358 | foreach ( $res as $obj ) { |
— | — | @@ -468,7 +468,7 @@ |
469 | 469 | $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); |
470 | 470 | |
471 | 471 | # Fetch the raw count |
472 | | - $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', |
| 472 | + $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', |
473 | 473 | array( 'wl_user' => $user->mId ), 'wlCountItems' ); |
474 | 474 | $row = $dbr->fetchObject( $res ); |
475 | 475 | $count = $row->count; |
Index: trunk/phase3/includes/specials/SpecialMovepage.php |
— | — | @@ -215,7 +215,7 @@ |
216 | 216 | Xml::element( 'legend', null, wfMsg( 'move-page-legend' ) ) . |
217 | 217 | Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-movepage-table' ) ) . |
218 | 218 | "<tr> |
219 | | - <td class='mw-label'>" . |
| 219 | + <td class='mw-label'>" . |
220 | 220 | wfMsgHtml( 'movearticle' ) . |
221 | 221 | "</td> |
222 | 222 | <td class='mw-input'> |
Index: trunk/phase3/includes/specials/SpecialDeadendpages.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | } |
48 | 48 | |
49 | 49 | function isSyndicated() { |
50 | | - return false; |
| 50 | + return false; |
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | ) ) ) |
74 | 74 | ); |
75 | 75 | } |
76 | | - |
| 76 | + |
77 | 77 | function getOrderFields() { |
78 | 78 | // For some crazy reason ordering by a constant |
79 | 79 | // causes a filesort |
Index: trunk/phase3/includes/specials/SpecialConfirmemail.php |
— | — | @@ -46,12 +46,12 @@ |
47 | 47 | function execute( $code ) { |
48 | 48 | global $wgUser, $wgOut; |
49 | 49 | $this->setHeaders(); |
50 | | - |
| 50 | + |
51 | 51 | if ( wfReadOnly() ) { |
52 | 52 | $wgOut->readOnlyPage(); |
53 | 53 | return; |
54 | 54 | } |
55 | | - |
| 55 | + |
56 | 56 | if( empty( $code ) ) { |
57 | 57 | if( $wgUser->isLoggedIn() ) { |
58 | 58 | if( User::isValidEmailAddr( $wgUser->getEmail() ) ) { |
— | — | @@ -150,11 +150,11 @@ |
151 | 151 | $this->setHeaders(); |
152 | 152 | |
153 | 153 | if ( wfReadOnly() ) { |
154 | | - global $wgOut; |
| 154 | + global $wgOut; |
155 | 155 | $wgOut->readOnlyPage(); |
156 | 156 | return; |
157 | 157 | } |
158 | | - |
| 158 | + |
159 | 159 | $this->attemptInvalidate( $code ); |
160 | 160 | } |
161 | 161 | |
Index: trunk/phase3/includes/specials/SpecialResetpass.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | $this->mNewpass = $wgRequest->getVal( 'wpNewPassword' ); |
49 | 49 | $this->mRetype = $wgRequest->getVal( 'wpRetype' ); |
50 | 50 | $this->mDomain = $wgRequest->getVal( 'wpDomain' ); |
51 | | - |
| 51 | + |
52 | 52 | $this->setHeaders(); |
53 | 53 | $this->outputHeader(); |
54 | 54 | $wgOut->disallowUserJs(); |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | } |
98 | 98 | $this->showForm(); |
99 | 99 | } |
100 | | - |
| 100 | + |
101 | 101 | function doReturnTo() { |
102 | 102 | global $wgRequest, $wgOut; |
103 | 103 | $titleObj = Title::newFromText( $wgRequest->getVal( 'returnto' ) ); |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | $rememberMe = '<tr>' . |
129 | 129 | '<td></td>' . |
130 | 130 | '<td class="mw-input">' . |
131 | | - Xml::checkLabel( |
| 131 | + Xml::checkLabel( |
132 | 132 | wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ), |
133 | 133 | 'wpRemember', 'wpRemember', |
134 | 134 | $wgRequest->getCheck( 'wpRemember' ) ) . |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | $out .= "\t<td class='mw-label'>"; |
195 | 195 | if ( $type != 'text' ) |
196 | 196 | $out .= Xml::label( wfMsg( $label ), $name ); |
197 | | - else |
| 197 | + else |
198 | 198 | $out .= wfMsgHtml( $label ); |
199 | 199 | $out .= "</td>\n"; |
200 | 200 | $out .= "\t<td class='mw-input'>$field</td>\n"; |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | if( !$user || $user->isAnon() ) { |
213 | 213 | throw new PasswordError( 'no such user' ); |
214 | 214 | } |
215 | | - |
| 215 | + |
216 | 216 | if( $newpass !== $retype ) { |
217 | 217 | wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'badretype' ) ); |
218 | 218 | throw new PasswordError( wfMsg( 'badretype' ) ); |
— | — | @@ -221,7 +221,7 @@ |
222 | 222 | wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'wrongpassword' ) ); |
223 | 223 | throw new PasswordError( wfMsg( 'resetpass-wrong-oldpass' ) ); |
224 | 224 | } |
225 | | - |
| 225 | + |
226 | 226 | try { |
227 | 227 | $user->setPassword( $this->mNewpass ); |
228 | 228 | wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'success' ) ); |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'error' ) ); |
232 | 232 | throw new PasswordError( $e->getMessage() ); |
233 | 233 | } |
234 | | - |
| 234 | + |
235 | 235 | $user->setCookies(); |
236 | 236 | $user->saveSettings(); |
237 | 237 | } |
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | return |
201 | 201 | Xml::checkLabel( wfMsg('protectedpages-indef'), 'indefonly', 'indefonly', $indefOnly ) . "\n"; |
202 | 202 | } |
203 | | - |
| 203 | + |
204 | 204 | /** |
205 | 205 | * @return string Formatted HTML |
206 | 206 | */ |
— | — | @@ -294,7 +294,7 @@ |
295 | 295 | public $mForm, $mConds; |
296 | 296 | private $type, $level, $namespace, $sizetype, $size, $indefonly; |
297 | 297 | |
298 | | - function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', $size=0, |
| 298 | + function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', $size=0, |
299 | 299 | $indefonly = false, $cascadeonly = false ) |
300 | 300 | { |
301 | 301 | $this->mForm = $form; |
— | — | @@ -329,7 +329,7 @@ |
330 | 330 | 'OR pr_expiry IS NULL)'; |
331 | 331 | $conds[] = 'page_id=pr_page'; |
332 | 332 | $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type ); |
333 | | - |
| 333 | + |
334 | 334 | if( $this->sizetype=='min' ) { |
335 | 335 | $conds[] = 'page_len>=' . $this->size; |
336 | 336 | } else if( $this->sizetype=='max' ) { |
Index: trunk/phase3/includes/specials/SpecialMostlinked.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | function __construct( $name = 'Mostlinked' ) { |
37 | 37 | parent::__construct( $name ); |
38 | 38 | } |
39 | | - |
| 39 | + |
40 | 40 | function isExpensive() { return true; } |
41 | 41 | function isSyndicated() { return false; } |
42 | 42 | |
Index: trunk/phase3/includes/specials/SpecialRandompage.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | |
67 | 67 | if( is_null( $title ) ) { |
68 | 68 | $this->setHeaders(); |
69 | | - $wgOut->addWikiMsg( strtolower( $this->mName ) . '-nopages', |
| 69 | + $wgOut->addWikiMsg( strtolower( $this->mName ) . '-nopages', |
70 | 70 | $this->getNsList(), count( $this->namespaces ) ); |
71 | 71 | return; |
72 | 72 | } |
Index: trunk/phase3/includes/specials/SpecialMIMEsearch.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | function linkParameters() { |
43 | 43 | return array( 'mime' => "{$this->major}/{$this->minor}" ); |
44 | 44 | } |
45 | | - |
| 45 | + |
46 | 46 | public function getQueryInfo() { |
47 | 47 | return array( |
48 | 48 | 'tables' => array( 'image' ), |
— | — | @@ -57,11 +57,11 @@ |
58 | 58 | 'img_minor_mime' => $this->minor ) |
59 | 59 | ); |
60 | 60 | } |
61 | | - |
| 61 | + |
62 | 62 | function execute( $par ) { |
63 | 63 | global $wgRequest, $wgOut; |
64 | 64 | $mime = $par ? $par : $wgRequest->getText( 'mime' ); |
65 | | - |
| 65 | + |
66 | 66 | $this->setHeaders(); |
67 | 67 | $this->outputHeader(); |
68 | 68 | $wgOut->addHTML( |
— | — | @@ -82,8 +82,8 @@ |
83 | 83 | } |
84 | 84 | parent::execute( $par ); |
85 | 85 | } |
86 | | - |
87 | 86 | |
| 87 | + |
88 | 88 | function formatResult( $skin, $result ) { |
89 | 89 | global $wgContLang, $wgLang; |
90 | 90 | |
Index: trunk/phase3/includes/specials/SpecialNewimages.php |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | $invertSort = true; |
104 | 104 | } |
105 | 105 | $sql = 'SELECT img_size, img_name, img_user, img_user_text,'. |
106 | | - "img_description,img_timestamp FROM $image"; |
| 106 | + "img_description,img_timestamp FROM $image"; |
107 | 107 | |
108 | 108 | if( $hidebotsql ) { |
109 | 109 | $sql .= $hidebotsql; |
Index: trunk/phase3/includes/specials/SpecialMostlinkedcategories.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | function __construct( $name = 'Mostlinkedcategories' ) { |
36 | 36 | parent::__construct( $name ); |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | function isExpensive() { return true; } |
40 | 40 | function isSyndicated() { return false; } |
41 | 41 | |
Index: trunk/phase3/includes/specials/SpecialDoubleRedirects.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | function __construct( $name = 'DoubleRedirects' ) { |
34 | 34 | parent::__construct( $name ); |
35 | 35 | } |
36 | | - |
| 36 | + |
37 | 37 | function isExpensive() { return true; } |
38 | 38 | function isSyndicated() { return false; } |
39 | 39 | function sortDescending() { return false; } |
Index: trunk/phase3/includes/specials/SpecialListredirects.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | function __construct( $name = 'Listredirects' ) { |
35 | 35 | parent::__construct( $name ); |
36 | 36 | } |
37 | | - |
| 37 | + |
38 | 38 | function isExpensive() { return true; } |
39 | 39 | function isSyndicated() { return false; } |
40 | 40 | function sortDescending() { return false; } |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | function getOrderFields() { |
62 | 62 | return array ( 'p1.page_namespace', 'p1.page_title' ); |
63 | 63 | } |
64 | | - |
| 64 | + |
65 | 65 | /** |
66 | 66 | * Cache page existence for performance |
67 | 67 | */ |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | $db->dataSeek( $res, 0 ); |
80 | 80 | } |
81 | 81 | } |
82 | | - |
| 82 | + |
83 | 83 | protected function getRedirectTarget( $row ) { |
84 | 84 | if ( isset( $row->rd_title ) ) { |
85 | 85 | return Title::makeTitle( $row->rd_namespace, |
Index: trunk/phase3/includes/specials/SpecialMergeHistory.php |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | wfEscapeWikiText( $this->mDestObj->getPrefixedText() ) |
118 | 118 | ); |
119 | 119 | } |
120 | | - |
| 120 | + |
121 | 121 | if ( $this->mTargetObj && $this->mDestObj && $this->mTargetObj->equals( $this->mDestObj ) ) { |
122 | 122 | $errors[] = wfMsgExt( 'mergehistory-same-destination', array( 'parse' ) ); |
123 | 123 | } |
Index: trunk/phase3/includes/specials/SpecialLinkSearch.php |
— | — | @@ -21,8 +21,8 @@ |
22 | 22 | * @ingroup SpecialPage |
23 | 23 | * @author Brion Vibber |
24 | 24 | */ |
25 | | - |
26 | 25 | |
| 26 | + |
27 | 27 | /** |
28 | 28 | * Special:LinkSearch to search the external-links table. |
29 | 29 | * @ingroup SpecialPage |
— | — | @@ -37,16 +37,16 @@ |
38 | 38 | function __construct( $name = 'LinkSearch' ) { |
39 | 39 | parent::__construct( $name ); |
40 | 40 | } |
41 | | - |
| 41 | + |
42 | 42 | function isCacheable() { |
43 | 43 | return false; |
44 | 44 | } |
45 | | - |
| 45 | + |
46 | 46 | function execute( $par ) { |
47 | 47 | global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang; |
48 | 48 | $this->setHeaders(); |
49 | 49 | $wgOut->allowClickjacking(); |
50 | | - |
| 50 | + |
51 | 51 | $target = $wgRequest->getVal( 'target', $par ); |
52 | 52 | $namespace = $wgRequest->getIntorNull( 'namespace', null ); |
53 | 53 | |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | $wgOut->addHTML( $s ); |
97 | 97 | |
98 | 98 | if( $target != '' ) { |
99 | | - $this->setParams( array( |
| 99 | + $this->setParams( array( |
100 | 100 | 'query' => $target2, |
101 | 101 | 'namespace' => $namespace, |
102 | 102 | 'protocol' => $protocol ) ); |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | if( $this->mMungedQuery === false ) |
151 | 151 | // Invalid query; return no results |
152 | 152 | return array( 'tables' => 'page', 'fields' => 'page_id', 'conds' => '0=1' ); |
153 | | - |
| 153 | + |
154 | 154 | $stripped = LinkFilter::keepOneWildcard( $this->mMungedQuery ); |
155 | 155 | $like = $dbr->buildLike( $stripped ); |
156 | 156 | $retval = array ( |
Index: trunk/phase3/includes/specials/SpecialEmailuser.php |
— | — | @@ -28,20 +28,20 @@ |
29 | 29 | */ |
30 | 30 | class SpecialEmailUser extends UnlistedSpecialPage { |
31 | 31 | protected $mTarget; |
32 | | - |
| 32 | + |
33 | 33 | public function __construct(){ |
34 | 34 | parent::__construct( 'Emailuser' ); |
35 | 35 | } |
36 | | - |
| 36 | + |
37 | 37 | protected function getFormFields(){ |
38 | 38 | global $wgUser; |
39 | 39 | return array( |
40 | 40 | 'From' => array( |
41 | 41 | 'type' => 'info', |
42 | 42 | 'raw' => 1, |
43 | | - 'default' => $wgUser->getSkin()->link( |
44 | | - $wgUser->getUserPage(), |
45 | | - htmlspecialchars( $wgUser->getName() ) |
| 43 | + 'default' => $wgUser->getSkin()->link( |
| 44 | + $wgUser->getUserPage(), |
| 45 | + htmlspecialchars( $wgUser->getName() ) |
46 | 46 | ), |
47 | 47 | 'label-message' => 'emailfrom', |
48 | 48 | 'id' => 'mw-emailuser-sender', |
— | — | @@ -49,8 +49,8 @@ |
50 | 50 | 'To' => array( |
51 | 51 | 'type' => 'info', |
52 | 52 | 'raw' => 1, |
53 | | - 'default' => $wgUser->getSkin()->link( |
54 | | - $this->mTargetObj->getUserPage(), |
| 53 | + 'default' => $wgUser->getSkin()->link( |
| 54 | + $this->mTargetObj->getUserPage(), |
55 | 55 | htmlspecialchars( $this->mTargetObj->getName() ) |
56 | 56 | ), |
57 | 57 | 'label-message' => 'emailto', |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | ), |
84 | 84 | ); |
85 | 85 | } |
86 | | - |
| 86 | + |
87 | 87 | public function execute( $par ) { |
88 | 88 | global $wgRequest, $wgOut, $wgUser; |
89 | 89 | |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | $this->mTarget = is_null( $par ) |
95 | 95 | ? $wgRequest->getVal( 'wpTarget', $wgRequest->getVal( 'target', '' ) ) |
96 | 96 | : $par; |
97 | | - |
| 97 | + |
98 | 98 | $ret = self::getTarget( $this->mTarget ); |
99 | 99 | if( $ret instanceof User ){ |
100 | 100 | $this->mTargetObj = $ret; |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | $wgOut->showErrorPage( "{$ret}title", "{$ret}text" ); |
103 | 103 | return false; |
104 | 104 | } |
105 | | - |
| 105 | + |
106 | 106 | $error = self::getPermissionsError( $wgUser, $wgRequest->getVal( 'wpEditToken' ) ); |
107 | 107 | switch ( $error ) { |
108 | 108 | case null: |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | $wgOut->showErrorPage( $title, $msg, $params ); |
128 | 128 | return; |
129 | 129 | } |
130 | | - |
| 130 | + |
131 | 131 | $form = new HTMLForm( $this->getFormFields() ); |
132 | 132 | $form->addPreText( wfMsgExt( 'emailpagetext', 'parseinline' ) ); |
133 | 133 | $form->setSubmitText( wfMsg( 'emailsend' ) ); |
— | — | @@ -134,14 +134,14 @@ |
135 | 135 | $form->setSubmitCallback( array( __CLASS__, 'submit' ) ); |
136 | 136 | $form->setWrapperLegend( wfMsgExt( 'email-legend', 'parsemag' ) ); |
137 | 137 | $form->loadData(); |
138 | | - |
| 138 | + |
139 | 139 | if( !wfRunHooks( 'EmailUserForm', array( &$form ) ) ){ |
140 | 140 | return false; |
141 | 141 | } |
142 | | - |
| 142 | + |
143 | 143 | $wgOut->setPagetitle( wfMsg( 'emailpage' ) ); |
144 | 144 | $result = $form->show(); |
145 | | - |
| 145 | + |
146 | 146 | if( $result === true || ( $result instanceof Status && $result->isGood() ) ){ |
147 | 147 | $wgOut->setPagetitle( wfMsg( 'emailsent' ) ); |
148 | 148 | $wgOut->addWikiMsg( 'emailsenttext' ); |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | wfDebug( "Target is empty.\n" ); |
162 | 162 | return 'notarget'; |
163 | 163 | } |
164 | | - |
| 164 | + |
165 | 165 | $nu = User::newFromName( $target ); |
166 | 166 | if( !$nu instanceof User || !$nu->getId() ) { |
167 | 167 | wfDebug( "Target is invalid user.\n" ); |
— | — | @@ -188,11 +188,11 @@ |
189 | 189 | if( !$wgEnableEmail || !$wgEnableUserEmail ){ |
190 | 190 | return 'usermaildisabled'; |
191 | 191 | } |
192 | | - |
| 192 | + |
193 | 193 | if( !$user->isAllowed( 'sendemail' ) ) { |
194 | 194 | return 'badaccess'; |
195 | 195 | } |
196 | | - |
| 196 | + |
197 | 197 | if( !$user->isEmailConfirmed() ){ |
198 | 198 | return 'mailnologin'; |
199 | 199 | } |
— | — | @@ -219,7 +219,7 @@ |
220 | 220 | |
221 | 221 | /** |
222 | 222 | * Really send a mail. Permissions should have been checked using |
223 | | - * getPermissionsError(). It is probably also a good |
| 223 | + * getPermissionsError(). It is probably also a good |
224 | 224 | * idea to check the edit token and ping limiter in advance. |
225 | 225 | * |
226 | 226 | * @return Mixed: Status object, or potentially a String on error |
— | — | @@ -239,17 +239,17 @@ |
240 | 240 | |
241 | 241 | // Add a standard footer and trim up trailing newlines |
242 | 242 | $text = rtrim( $text ) . "\n\n-- \n"; |
243 | | - $text .= wfMsgExt( |
| 243 | + $text .= wfMsgExt( |
244 | 244 | 'emailuserfooter', |
245 | | - array( 'content', 'parsemag' ), |
246 | | - array( $from->name, $to->name ) |
| 245 | + array( 'content', 'parsemag' ), |
| 246 | + array( $from->name, $to->name ) |
247 | 247 | ); |
248 | 248 | |
249 | 249 | $error = ''; |
250 | 250 | if( !wfRunHooks( 'EmailUser', array( &$to, &$from, &$subject, &$text, &$error ) ) ) { |
251 | 251 | return $error; |
252 | 252 | } |
253 | | - |
| 253 | + |
254 | 254 | if( $wgUserEmailUseReplyTo ) { |
255 | 255 | // Put the generic wiki autogenerated address in the From: |
256 | 256 | // header and reserve the user for Reply-To. |
— | — | @@ -284,12 +284,12 @@ |
285 | 285 | return $status; |
286 | 286 | } else { |
287 | 287 | // if the user requested a copy of this mail, do this now, |
288 | | - // unless they are emailing themselves, in which case one |
| 288 | + // unless they are emailing themselves, in which case one |
289 | 289 | // copy of the message is sufficient. |
290 | 290 | if ( $data['CCMe'] && $to != $from ) { |
291 | 291 | $cc_subject = wfMsg( |
292 | | - 'emailccsubject', |
293 | | - $target->getName(), |
| 292 | + 'emailccsubject', |
| 293 | + $target->getName(), |
294 | 294 | $subject |
295 | 295 | ); |
296 | 296 | wfRunHooks( 'EmailUserCC', array( &$from, &$from, &$cc_subject, &$text ) ); |