From: Alexandre Emsenhuber Date: Mon, 24 Mar 2008 15:04:55 +0000 (+0000) Subject: * Fixed call to deprecated functions X-Git-Tag: 1.31.0-rc.0~48851 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=2ed1bedb949fa19f5fda1c3ef789d92fa1ae0e23;p=lhc%2Fweb%2Fwiklou.git * Fixed call to deprecated functions * Remove unused global declaration of $wgArticle in SkinTemplate::buildNavUrls() --- diff --git a/includes/Article.php b/includes/Article.php index 4404625ba2..26b64944fd 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1518,7 +1518,7 @@ class Article { # Check patrol config options if ( !($wgUseNPPatrol || $wgUseRCPatrol)) { - $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' ); + $wgOut->showErrorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' ); return; } @@ -1527,7 +1527,7 @@ class Article { $rc = $rcid ? RecentChange::newFromId($rcid) : null; if ( is_null ( $rc ) ) { - $wgOut->errorPage( 'markedaspatrollederror', 'markedaspatrollederrortext' ); + $wgOut->showErrorPage( 'markedaspatrollederror', 'markedaspatrollederrortext' ); return; } @@ -1535,7 +1535,7 @@ class Article { // Only new pages can be patrolled if the general patrolling is off....??? // @fixme -- is this necessary? Shouldn't we only bother controlling the // front end here? - $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' ); + $wgOut->showErrorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' ); return; } diff --git a/includes/EditPage.php b/includes/EditPage.php index 25f1e024b6..33f78e0381 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -687,7 +687,7 @@ class EditPage { if( $title instanceof Title && $title->exists() && $title->userCanRead() ) { global $wgOut; $revision = Revision::newFromTitle( $title ); - $wgOut->addSecondaryWikiText( $revision->getText() ); + $wgOut->addWikiTextTitleTidy( $revision->getText(), $this->mTitle ); return true; } else { return false; diff --git a/includes/ImagePage.php b/includes/ImagePage.php index bcdb342006..002fc250c3 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -38,7 +38,7 @@ class ImagePage extends Article { function render() { global $wgOut; $wgOut->setArticleBodyOnly( true ); - $wgOut->addSecondaryWikitext( $this->getContent() ); + $wgOut->addWikiTextTitleTidy( $this->getContent(), $this->mTitle ); } function view() { diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index fd84b54698..22fefb5157 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -397,7 +397,7 @@ class SkinTemplate extends Skin { $tpl->set( 'about', $this->aboutLink() ); $tpl->setRef( 'debug', $out->mDebugtext ); - $tpl->set( 'reporttime', $out->reportTime() ); + $tpl->set( 'reporttime', wfReportTime() ); $tpl->set( 'sitenotice', wfGetSiteNotice() ); $tpl->set( 'bottomscripts', $this->bottomScripts() ); @@ -838,14 +838,12 @@ class SkinTemplate extends Skin { * @private */ function buildNavUrls () { - global $wgUseTrackbacks, $wgTitle, $wgArticle; + global $wgUseTrackbacks, $wgTitle, $wgUser, $wgRequest; + global $wgEnableUploads, $wgUploadNavigationUrl; $fname = 'SkinTemplate::buildNavUrls'; wfProfileIn( $fname ); - global $wgUser, $wgRequest; - global $wgEnableUploads, $wgUploadNavigationUrl; - $action = $wgRequest->getText( 'action' ); $nav_urls = array(); diff --git a/includes/SpecialLockdb.php b/includes/SpecialLockdb.php index b523591c04..4f140dffae 100644 --- a/includes/SpecialLockdb.php +++ b/includes/SpecialLockdb.php @@ -104,7 +104,7 @@ END # This used to show a file not found error, but the likeliest reason for fopen() # to fail at this point is insufficient permission to write to the file...good old # is_writable() is plain wrong in some cases, it seems... - $this->notWritable(); + self::notWritable(); return; } fwrite( $fp, $this->reason ); @@ -126,7 +126,7 @@ END public static function notWritable() { global $wgOut; - $wgOut->errorPage( 'lockdb', 'lockfilenotwritable' ); + $wgOut->showErrorPage( 'lockdb', 'lockfilenotwritable' ); } } diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 00d26e90b3..57e973f8b5 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -356,7 +356,7 @@ class PreferencesForm { return; } - $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) ); + $wgOut->parserOptions( ParserOptions::newFromUser( $wgUser ) ); $this->mainPrefsForm( $error === false ? 'success' : 'error', $error); } diff --git a/includes/SpecialRecentchangeslinked.php b/includes/SpecialRecentchangeslinked.php index 424560384e..ee01dfa3e7 100644 --- a/includes/SpecialRecentchangeslinked.php +++ b/includes/SpecialRecentchangeslinked.php @@ -25,12 +25,12 @@ function wfSpecialRecentchangeslinked( $par = NULL ) { $sk = $wgUser->getSkin(); if (is_null($target)) { - $wgOut->errorpage( 'notargettitle', 'notargettext' ); + $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); return; } $nt = Title::newFromURL( $target ); if( !$nt ) { - $wgOut->errorpage( 'notargettitle', 'notargettext' ); + $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); return; } $id = $nt->getArticleId(); diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index d0d46de36f..6beb1cb15a 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -166,7 +166,7 @@ class UploadForm { $url = trim( $url ); if( stripos($url, 'http://') !== 0 && stripos($url, 'ftp://') !== 0 ) { # Only HTTP or FTP URLs - $wgOut->errorPage( 'upload-proto-error', 'upload-proto-error-text' ); + $wgOut->showErrorPage( 'upload-proto-error', 'upload-proto-error-text' ); return true; } @@ -174,7 +174,7 @@ class UploadForm { $this->mCurlDestHandle = @fopen( $this->mTempPath, "wb" ); if( $this->mCurlDestHandle === false ) { # Could not open temporary file to write in - $wgOut->errorPage( 'upload-file-error', 'upload-file-error-text'); + $wgOut->showErrorPage( 'upload-file-error', 'upload-file-error-text'); return true; } @@ -195,9 +195,9 @@ class UploadForm { if( $error ) { unlink( $dest ); if( wfEmptyMsg( "upload-curl-error$errornum", wfMsg("upload-curl-error$errornum") ) ) - $wgOut->errorPage( 'upload-misc-error', 'upload-misc-error-text' ); + $wgOut->showErrorPage( 'upload-misc-error', 'upload-misc-error-text' ); else - $wgOut->errorPage( "upload-curl-error$errornum", "upload-curl-error$errornum-text" ); + $wgOut->showErrorPage( "upload-curl-error$errornum", "upload-curl-error$errornum-text" ); } return $error; @@ -376,9 +376,9 @@ class UploadForm { return self::BEFORE_PROCESSING; } - /* Check for PHP error if any, requires php 4.2 or newer */ - if( $this->mCurlError == 1/*UPLOAD_ERR_INI_SIZE*/ ) { - return self::LARGE_FILE_SERVER; + /* Check for curl error */ + if( $this->mCurlError ) { + return self::BEFORE_PROCESSING; } /** diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 88ad23604b..72daf8966d 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -487,7 +487,7 @@ class LoginForm { $this->resetLoginForm( wfMsg( 'resetpass_announce' ) ); break; default: - wfDebugDieBacktrace( "Unhandled case value" ); + throw new MWException( "Unhandled case value" ); } } diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php index db2750cd66..033302c94c 100644 --- a/includes/SquidUpdate.php +++ b/includes/SquidUpdate.php @@ -219,7 +219,7 @@ class SquidUpdate { foreach ( $urlArr as $url ) { if( !is_string( $url ) ) { - wfDebugDieBacktrace( 'Bad purge URL' ); + throw new MWException( 'Bad purge URL' ); } $url = SquidUpdate::expand( $url ); diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 7568157d8b..b92bd56adc 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -640,7 +640,7 @@ abstract class ApiBase { * Internal code errors should be reported with this method */ protected static function dieDebug($method, $message) { - wfDebugDieBacktrace("Internal error in $method: $message"); + throw new MWException("Internal error in $method: $message"); } /**