$this->insertRedirectEntry( $retval );
return $retval;
}
-
+
/**
* Insert or update the redirect table entry for this page to indicate
* it redirects to $rt .
// recurse through to only get the final target
return $this->getRedirectURL( Title::newFromRedirectRecurse( $text ) );
}
-
+
/**
* Get the Title object or URL to use for a redirect. We use Title
* objects for same-wiki, non-special redirects and URLs for everything
if ( $oldid === $this->getLatest() && $this->useParserCache( false ) ) {
$this->mParserOutput = $parserCache->get( $this, $parserOptions );
if ( $this->mParserOutput ) {
- wfDebug( __METHOD__ . ": showing parser cache for current rev permalink\n" );
+ wfDebug( __METHOD__ . ": showing parser cache for current rev permalink\n" );
$wgOut->addParserOutput( $this->mParserOutput );
$wgOut->setRevisionId( $this->mLatest );
$outputDone = true;
- break;
+ break;
}
}
}
# Run the parse, protected by a pool counter
wfDebug( __METHOD__ . ": doing uncached parse\n" );
- $this->checkTouched();
$key = $parserCache->getKey( $this, $parserOptions );
$poolArticleView = new PoolWorkArticleView( $this, $key, $useParserCache, $parserOptions );
-
+
if ( !$poolArticleView->execute() ) {
# Connection or timeout error
wfProfileOut( __METHOD__ );
if ( !$this->isCurrent() || $wgOut->isPrintable() ) {
$parserOptions->setEditSection( false );
}
-
+
$useParserCache = $this->useParserCache( $oldid );
$this->outputWikiText( $this->getContent(), $useParserCache, $parserOptions );
-
+
return true;
}
global $wgOut;
$parserCache = ParserCache::singleton();
$options = clone $this->getParserOptions();
-
+
if ( $wgOut->isPrintable() ) {
$options->setIsPrintable( true );
$options->setEditSection( false );
}
-
+
$output = $parserCache->getDirty( $this, $options );
if ( $output ) {
}
}
- $imageUrl = $wgStylePath . '/common/images/redirect' . $imageDir . '.png';
+ $imageUrl = $wgStylePath . '/common/images/redirect' . $imageDir . '.png';
return '<div class="redirectMsg">' .
Html::element( 'img', array( 'src' => $imageUrl, 'alt' => '#REDIRECT' ) ) .
'<span class="redirectText">' . $link . '</span></div>';
$form = Html::openElement( 'form', $formParams );
$form .= Xml::submitButton( wfMsg( 'confirm_purge_button' ) );
$form .= Html::closeElement( 'form' );
-
+
$wgOut->addHTML( $form );
$wgOut->addWikiMsg( 'confirm-purge-bottom' );
'parent_id' => $this->mLatest,
'user' => $user->getId(),
'user_text' => $user->getName(),
+ 'timestamp' => $now
) );
$dbw->begin();
# Update recentchanges
if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
# Mark as patrolled if the user can do so
- $patrolled = $wgUseRCPatrol && $this->mTitle->userCan( 'autopatrol' );
+ $patrolled = $wgUseRCPatrol && !count(
+ $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
# Add RC row to the DB
$rc = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $user, $summary,
$this->mLatest, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
'text' => $text,
'user' => $user->getId(),
'user_text' => $user->getName(),
- ) );
+ 'timestamp' => $now
+ ) );
$revisionId = $revision->insertOn( $dbw );
$this->mTitle->resetArticleID( $newid );
global $wgUseRCPatrol, $wgUseNPPatrol;
# Mark as patrolled if the user can do so
- $patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol ) && $this->mTitle->userCan( 'autopatrol' );
+ $patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol ) && !count(
+ $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
# Add RC row to the DB
$rc = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $user, $summary, $bot,
'', strlen( $text ), $revisionId, $patrolled );
$id = $this->mTitle->getArticleID();
if ( $id <= 0 ) {
- wfDebug( "updateRestrictions failed: $id <= 0\n" );
+ wfDebug( "updateRestrictions failed: article id $id <= 0\n" );
return false;
}
$cacheable = false;
if ( HTMLFileCache::useFileCache() ) {
- $cacheable = $this->getID() && !$this->mRedirectedFrom;
+ $cacheable = $this->getID() && !$this->mRedirectedFrom && !$this->mTitle->isRedirect();
// Extension may have reason to disable file caching on some pages.
if ( $cacheable ) {
$cacheable = wfRunHooks( 'IsFileCacheable', array( &$this ) );
*/
public static function getAutosummary( $oldtext, $newtext, $flags ) {
global $wgContLang;
-
+
# Decide what kind of autosummary is needed.
# Redirect autosummaries
$this->mParserOptions->enableLimitReport();
}
- // Clone to allow modifications of the return value without affecting
+ // Clone to allow modifications of the return value without affecting
// the cache
return clone $this->mParserOptions;
}
* consider, so it's not appropriate to use there.
*
* @since 1.16 (r52326) for LiquidThreads
- *
+ *
* @param $oldid mixed integer Revision ID or null
*/
public function getParserOutput( $oldid = null ) {
class PoolWorkArticleView extends PoolCounterWork {
private $mArticle;
-
+
function __construct( $article, $key, $useParserCache, $parserOptions ) {
parent::__construct( 'ArticleView', $key );
$this->mArticle = $article;
$this->cacheable = $useParserCache;
$this->parserOptions = $parserOptions;
}
-
+
function doWork() {
return $this->mArticle->doViewParse();
}
-
+
function getCachedWork() {
global $wgOut;
-
+
$parserCache = ParserCache::singleton();
$this->mArticle->mParserOutput = $parserCache->get( $this->mArticle, $this->parserOptions );
}
return false;
}
-
+
function fallback() {
return $this->mArticle->tryDirtyCache();
}
-
+
function error( $status ) {
global $wgOut;
$wgOut->clearHTML(); // for release() errors
$wgOut->enableClientCache( false );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
-
+
$errortext = $status->getWikiText( false, 'view-pool-error' );
$wgOut->addWikiText( '<div class="errorbox">' . $errortext . '</div>' );
-
+
return false;
}
}