* Fixed call to deprecated functions
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 24 Mar 2008 15:04:55 +0000 (15:04 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 24 Mar 2008 15:04:55 +0000 (15:04 +0000)
* Remove unused global declaration of $wgArticle in SkinTemplate::buildNavUrls()

includes/Article.php
includes/EditPage.php
includes/ImagePage.php
includes/SkinTemplate.php
includes/SpecialLockdb.php
includes/SpecialPreferences.php
includes/SpecialRecentchangeslinked.php
includes/SpecialUpload.php
includes/SpecialUserlogin.php
includes/SquidUpdate.php
includes/api/ApiBase.php

index 4404625..26b6494 100644 (file)
@@ -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;
                }
                
index 25f1e02..33f78e0 100644 (file)
@@ -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;
index bcdb342..002fc25 100644 (file)
@@ -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() {
index fd84b54..22fefb5 100644 (file)
@@ -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();
index b523591..4f140df 100644 (file)
@@ -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' );
        }
        
 }
index 00d26e9..57e973f 100644 (file)
@@ -356,7 +356,7 @@ class PreferencesForm {
                        return;
                }
 
-               $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) );
+               $wgOut->parserOptions( ParserOptions::newFromUser( $wgUser ) );
                $this->mainPrefsForm( $error === false ? 'success' : 'error', $error);
        }
 
index 4245603..ee01dfa 100644 (file)
@@ -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();
index d0d46de..6beb1cb 100644 (file)
@@ -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;
                }
 
                /**
index 88ad236..72daf89 100644 (file)
@@ -487,7 +487,7 @@ class LoginForm {
                                $this->resetLoginForm( wfMsg( 'resetpass_announce' ) );
                                break;
                        default:
-                               wfDebugDieBacktrace( "Unhandled case value" );
+                               throw new MWException( "Unhandled case value" );
                }
        }
 
index db2750c..033302c 100644 (file)
@@ -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 );
                                
index 7568157..b92bd56 100644 (file)
@@ -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");
        }
 
        /**