r32372 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32371‎ | r32372 | r32373 >
Date:15:04, 24 March 2008
Author:ialex
Status:old
Tags:
Comment:
* Fixed call to deprecated functions
* Remove unused global declaration of $wgArticle in SkinTemplate::buildNavUrls()
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/SpecialLockdb.php (modified) (history)
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/SpecialRecentchangeslinked.php (modified) (history)
  • /trunk/phase3/includes/SpecialUpload.php (modified) (history)
  • /trunk/phase3/includes/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/SquidUpdate.php (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialRecentchangeslinked.php
@@ -25,12 +25,12 @@
2626 $sk = $wgUser->getSkin();
2727
2828 if (is_null($target)) {
29 - $wgOut->errorpage( 'notargettitle', 'notargettext' );
 29+ $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
3030 return;
3131 }
3232 $nt = Title::newFromURL( $target );
3333 if( !$nt ) {
34 - $wgOut->errorpage( 'notargettitle', 'notargettext' );
 34+ $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
3535 return;
3636 }
3737 $id = $nt->getArticleId();
Index: trunk/phase3/includes/Article.php
@@ -1518,7 +1518,7 @@
15191519 # Check patrol config options
15201520
15211521 if ( !($wgUseNPPatrol || $wgUseRCPatrol)) {
1522 - $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
 1522+ $wgOut->showErrorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
15231523 return;
15241524 }
15251525
@@ -1527,7 +1527,7 @@
15281528 $rc = $rcid ? RecentChange::newFromId($rcid) : null;
15291529 if ( is_null ( $rc ) )
15301530 {
1531 - $wgOut->errorPage( 'markedaspatrollederror', 'markedaspatrollederrortext' );
 1531+ $wgOut->showErrorPage( 'markedaspatrollederror', 'markedaspatrollederrortext' );
15321532 return;
15331533 }
15341534
@@ -1535,7 +1535,7 @@
15361536 // Only new pages can be patrolled if the general patrolling is off....???
15371537 // @fixme -- is this necessary? Shouldn't we only bother controlling the
15381538 // front end here?
1539 - $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
 1539+ $wgOut->showErrorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
15401540 return;
15411541 }
15421542
Index: trunk/phase3/includes/SpecialLockdb.php
@@ -104,7 +104,7 @@
105105 # This used to show a file not found error, but the likeliest reason for fopen()
106106 # to fail at this point is insufficient permission to write to the file...good old
107107 # is_writable() is plain wrong in some cases, it seems...
108 - $this->notWritable();
 108+ self::notWritable();
109109 return;
110110 }
111111 fwrite( $fp, $this->reason );
@@ -126,7 +126,7 @@
127127
128128 public static function notWritable() {
129129 global $wgOut;
130 - $wgOut->errorPage( 'lockdb', 'lockfilenotwritable' );
 130+ $wgOut->showErrorPage( 'lockdb', 'lockfilenotwritable' );
131131 }
132132
133133 }
Index: trunk/phase3/includes/SpecialUserlogin.php
@@ -487,7 +487,7 @@
488488 $this->resetLoginForm( wfMsg( 'resetpass_announce' ) );
489489 break;
490490 default:
491 - wfDebugDieBacktrace( "Unhandled case value" );
 491+ throw new MWException( "Unhandled case value" );
492492 }
493493 }
494494
Index: trunk/phase3/includes/ImagePage.php
@@ -38,7 +38,7 @@
3939 function render() {
4040 global $wgOut;
4141 $wgOut->setArticleBodyOnly( true );
42 - $wgOut->addSecondaryWikitext( $this->getContent() );
 42+ $wgOut->addWikiTextTitleTidy( $this->getContent(), $this->mTitle );
4343 }
4444
4545 function view() {
Index: trunk/phase3/includes/EditPage.php
@@ -687,7 +687,7 @@
688688 if( $title instanceof Title && $title->exists() && $title->userCanRead() ) {
689689 global $wgOut;
690690 $revision = Revision::newFromTitle( $title );
691 - $wgOut->addSecondaryWikiText( $revision->getText() );
 691+ $wgOut->addWikiTextTitleTidy( $revision->getText(), $this->mTitle );
692692 return true;
693693 } else {
694694 return false;
Index: trunk/phase3/includes/SpecialUpload.php
@@ -166,7 +166,7 @@
167167 $url = trim( $url );
168168 if( stripos($url, 'http://') !== 0 && stripos($url, 'ftp://') !== 0 ) {
169169 # Only HTTP or FTP URLs
170 - $wgOut->errorPage( 'upload-proto-error', 'upload-proto-error-text' );
 170+ $wgOut->showErrorPage( 'upload-proto-error', 'upload-proto-error-text' );
171171 return true;
172172 }
173173
@@ -174,7 +174,7 @@
175175 $this->mCurlDestHandle = @fopen( $this->mTempPath, "wb" );
176176 if( $this->mCurlDestHandle === false ) {
177177 # Could not open temporary file to write in
178 - $wgOut->errorPage( 'upload-file-error', 'upload-file-error-text');
 178+ $wgOut->showErrorPage( 'upload-file-error', 'upload-file-error-text');
179179 return true;
180180 }
181181
@@ -195,9 +195,9 @@
196196 if( $error ) {
197197 unlink( $dest );
198198 if( wfEmptyMsg( "upload-curl-error$errornum", wfMsg("upload-curl-error$errornum") ) )
199 - $wgOut->errorPage( 'upload-misc-error', 'upload-misc-error-text' );
 199+ $wgOut->showErrorPage( 'upload-misc-error', 'upload-misc-error-text' );
200200 else
201 - $wgOut->errorPage( "upload-curl-error$errornum", "upload-curl-error$errornum-text" );
 201+ $wgOut->showErrorPage( "upload-curl-error$errornum", "upload-curl-error$errornum-text" );
202202 }
203203
204204 return $error;
@@ -376,9 +376,9 @@
377377 return self::BEFORE_PROCESSING;
378378 }
379379
380 - /* Check for PHP error if any, requires php 4.2 or newer */
381 - if( $this->mCurlError == 1/*UPLOAD_ERR_INI_SIZE*/ ) {
382 - return self::LARGE_FILE_SERVER;
 380+ /* Check for curl error */
 381+ if( $this->mCurlError ) {
 382+ return self::BEFORE_PROCESSING;
383383 }
384384
385385 /**
Index: trunk/phase3/includes/api/ApiBase.php
@@ -640,7 +640,7 @@
641641 * Internal code errors should be reported with this method
642642 */
643643 protected static function dieDebug($method, $message) {
644 - wfDebugDieBacktrace("Internal error in $method: $message");
 644+ throw new MWException("Internal error in $method: $message");
645645 }
646646
647647 /**
Index: trunk/phase3/includes/SkinTemplate.php
@@ -397,7 +397,7 @@
398398 $tpl->set( 'about', $this->aboutLink() );
399399
400400 $tpl->setRef( 'debug', $out->mDebugtext );
401 - $tpl->set( 'reporttime', $out->reportTime() );
 401+ $tpl->set( 'reporttime', wfReportTime() );
402402 $tpl->set( 'sitenotice', wfGetSiteNotice() );
403403 $tpl->set( 'bottomscripts', $this->bottomScripts() );
404404
@@ -838,14 +838,12 @@
839839 * @private
840840 */
841841 function buildNavUrls () {
842 - global $wgUseTrackbacks, $wgTitle, $wgArticle;
 842+ global $wgUseTrackbacks, $wgTitle, $wgUser, $wgRequest;
 843+ global $wgEnableUploads, $wgUploadNavigationUrl;
843844
844845 $fname = 'SkinTemplate::buildNavUrls';
845846 wfProfileIn( $fname );
846847
847 - global $wgUser, $wgRequest;
848 - global $wgEnableUploads, $wgUploadNavigationUrl;
849 -
850848 $action = $wgRequest->getText( 'action' );
851849
852850 $nav_urls = array();
Index: trunk/phase3/includes/SpecialPreferences.php
@@ -356,7 +356,7 @@
357357 return;
358358 }
359359
360 - $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) );
 360+ $wgOut->parserOptions( ParserOptions::newFromUser( $wgUser ) );
361361 $this->mainPrefsForm( $error === false ? 'success' : 'error', $error);
362362 }
363363
Index: trunk/phase3/includes/SquidUpdate.php
@@ -219,7 +219,7 @@
220220
221221 foreach ( $urlArr as $url ) {
222222 if( !is_string( $url ) ) {
223 - wfDebugDieBacktrace( 'Bad purge URL' );
 223+ throw new MWException( 'Bad purge URL' );
224224 }
225225 $url = SquidUpdate::expand( $url );
226226

Follow-up revisions

RevisionCommit summaryAuthorDate
r32569(bug 13556, and possible regression from r32372) Don't show a blank form if n...ialex17:40, 29 March 2008

Status & tagging log