* Remove unused global declaration of $wgArticle in SkinTemplate::buildNavUrls()
# Check patrol config options
if ( !($wgUseNPPatrol || $wgUseRCPatrol)) {
- $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
+ $wgOut->showErrorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
return;
}
$rc = $rcid ? RecentChange::newFromId($rcid) : null;
if ( is_null ( $rc ) )
{
- $wgOut->errorPage( 'markedaspatrollederror', 'markedaspatrollederrortext' );
+ $wgOut->showErrorPage( 'markedaspatrollederror', 'markedaspatrollederrortext' );
return;
}
// 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;
}
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;
function render() {
global $wgOut;
$wgOut->setArticleBodyOnly( true );
- $wgOut->addSecondaryWikitext( $this->getContent() );
+ $wgOut->addWikiTextTitleTidy( $this->getContent(), $this->mTitle );
}
function view() {
$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() );
* @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();
# 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 );
public static function notWritable() {
global $wgOut;
- $wgOut->errorPage( 'lockdb', 'lockfilenotwritable' );
+ $wgOut->showErrorPage( 'lockdb', 'lockfilenotwritable' );
}
}
return;
}
- $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) );
+ $wgOut->parserOptions( ParserOptions::newFromUser( $wgUser ) );
$this->mainPrefsForm( $error === false ? 'success' : 'error', $error);
}
$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();
$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;
}
$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;
}
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;
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;
}
/**
$this->resetLoginForm( wfMsg( 'resetpass_announce' ) );
break;
default:
- wfDebugDieBacktrace( "Unhandled case value" );
+ throw new MWException( "Unhandled case value" );
}
}
foreach ( $urlArr as $url ) {
if( !is_string( $url ) ) {
- wfDebugDieBacktrace( 'Bad purge URL' );
+ throw new MWException( 'Bad purge URL' );
}
$url = SquidUpdate::expand( $url );
* 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");
}
/**