}
if( !$this->mContentModel ) {
- throw new MWException( "failed to determin content model!" );
+ throw new MWException( 'Failed to determine content model!' );
}
return $this->mContentModel;
* @return Array list of errors
*/
private function checkSpecialsAndNSPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
- # Only 'createaccount' and 'execute' can be performed on
- # special pages, which don't actually exist in the DB.
- $specialOKActions = array( 'createaccount', 'execute', 'read' );
- if ( NS_SPECIAL == $this->mNamespace && !in_array( $action, $specialOKActions ) ) {
+ # Only 'createaccount' can be performed on special pages,
+ # which don't actually exist in the DB.
+ if ( NS_SPECIAL == $this->mNamespace && $action !== 'createaccount' ) {
$errors[] = array( 'ns-specialprotected' );
}
$expiry = array( 'create' => $expiry );
$page = WikiPage::factory( $this );
- $status = $page->doUpdateRestrictions( $limit, $expiry, false, $reason, $wgUser );
+ $cascade = false;
+ $status = $page->doUpdateRestrictions( $limit, $expiry, $cascade, $reason, $wgUser );
return $status->isOK();
}
return $this->mLatestID = 0;
}
$linkCache = LinkCache::singleton();
+ $linkCache->addLinkObj( $this );
$cached = $linkCache->getGoodLinkFieldObj( $this, 'revision' );
if ( $cached === null ) { # check the assumption that the cache actually knows about this title
# XXX: this does apparently happen, see https://bugzilla.wikimedia.org/show_bug.cgi?id=37209
if ( !$wgContentHandlerUseDB &&
$this->getContentModel() !== $nt->getContentModel() ) {
// can't move a page if that would change the page's content model
- $errors[] = array( 'bad-target-model',
- ContentHandler::getLocalizedName( $this->getContentModel() ),
- ContentHandler::getLocalizedName( $nt->getContentModel() ) );
+ $errors[] = array(
+ 'bad-target-model',
+ ContentHandler::getLocalizedName( $this->getContentModel() ),
+ ContentHandler::getLocalizedName( $nt->getContentModel() )
+ );
}
// Image-specific checks
array()
);
- if ( $dbr->numRows( $res ) > 0 ) {
+ if ( $res->numRows() > 0 ) {
foreach ( $res as $row ) {
// $data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to);
$data[$wgContLang->getNSText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText();
* @return Bool true if the update succeded
*/
public function invalidateCache() {
+ global $wgMemc;
if ( wfReadOnly() ) {
return false;
}
__METHOD__
);
HTMLFileCache::clearFileCache( $this );
+
+ // Clear page info.
+ $revision = WikiPage::factory( $this )->getRevision();
+ if( $revision !== null ) {
+ $memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $revision->getId() );
+ $success = $success && $wgMemc->delete( $memcKey );
+ }
+
return $success;
}