$text = $this->getContent();
return self::followRedirectText( $text );
}
-
+
/**
* Get the Title object this text redirects to
*
*/
function isRedirect( $text = false ) {
if ( $text === false ) {
- if ( $this->mDataLoaded )
+ if ( $this->mDataLoaded )
return $this->mIsRedirect;
-
+
// Apparently loadPageData was never called
$this->loadContent();
$titleObj = Title::newFromRedirect( $this->fetchContent() );
if ($limit > 0) { $sql .= ' LIMIT '.$limit; }
if ($offset > 0) { $sql .= ' OFFSET '.$offset; }
-
+
$sql .= ' '. $this->getSelectOptions();
$res = $dbr->query($sql, __METHOD__);
}
}
}
-
+
$wgOut->setRevisionId( $this->getRevIdFetched() );
// Pages containing custom CSS or JavaScript get special treatment
$this->viewUpdates();
wfProfileOut( __METHOD__ );
}
-
- /*
+
+ /*
* Should the parser cache be used?
*/
protected function useParserCache( $oldid ) {
global $wgUser, $wgEnableParserCache;
-
+
return $wgEnableParserCache
&& intval( $wgUser->getOption( 'stubthreshold' ) ) == 0
&& $this->exists()
&& !$this->mTitle->isCssOrJsPage()
&& !$this->mTitle->isCssJsSubpage();
}
-
+
/**
* View redirect
* @param Title $target Title of destination to redirect
*/
public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
global $wgParser, $wgOut, $wgContLang, $wgStylePath, $wgUser;
-
+
# Display redirect
$imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
$imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png';
-
+
if( $appendSubtitle ) {
$wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) );
}
return '<img src="'.$imageUrl.'" alt="#REDIRECT " />' .
'<span class="redirectText">'.$link.'</span>';
-
+
}
function addTrackbacks() {
# Update the page record with revision data
$this->updateRevisionOn( $dbw, $revision, 0 );
-
+
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) );
if( !( $flags & EDIT_SUPPRESS_RC ) ) {
'page_id' => $id
), 'Article::protect'
);
-
+
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $nullRevision, $latest) );
wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) );
# Update the protection log
$log = new LogPage( 'protect' );
if( $protect ) {
- $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle,
+ $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle,
trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
} else {
$log->addEntry( 'unprotect', $this->mTitle, $reason );
function doDelete( $reason, $suppress = false ) {
global $wgOut, $wgUser;
wfDebug( __METHOD__."\n" );
-
+
$id = $this->getId();
-
+
$error = '';
if (wfRunHooks('ArticleDelete', array(&$this, &$wgUser, &$reason, &$error))) {
if( empty( $summary ) ){
$summary = wfMsgForContent( 'revertpage' );
}
-
+
# Allow the custom summary to use the same args as the default message
$args = array(
$target->getUserText(), $from, $s->rev_id,
$wgLang->timeanddate(wfTimestamp(TS_MW, $s->rev_timestamp), true),
$current->getId(), $wgLang->timeanddate($current->getTimestamp())
);
- $summary = wfMsgReplaceArgs( $summary, $args );
+ $summary = wfMsgReplaceArgs( $summary, $args );
# Save
$flags = EDIT_UPDATE;
. $wgUser->getSkin()->userToolLinks( $target->getUser(), $target->getUserText() );
$wgOut->addHtml( wfMsgExt( 'rollback-success', array( 'parse', 'replaceafter' ), $old, $new ) );
$wgOut->returnToMain( false, $this->mTitle );
-
+
if( !$wgRequest->getBool( 'hidediff', false ) ) {
$de = new DifferenceEngine( $this->mTitle, $current->getId(), 'next', false, true );
$de->showDiff( '', '' );
if( User::isIP( $shortTitle ) ) {
// An anonymous user
$other->setNewtalk( true );
- } elseif( $other->isLoggedIn() ) {
+ } elseif( $other instanceof User && $other->isLoggedIn() ) {
$other->setNewtalk( true );
} else {
wfDebug( __METHOD__. ": don't need to notify a nonexistent user\n" );
$revision->insertOn( $dbw );
$this->updateRevisionOn( $dbw, $revision );
$dbw->commit();
-
+
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) );
wfProfileOut( __METHOD__ );