From: Antoine Musso Date: Sun, 7 Nov 2010 11:54:48 +0000 (+0000) Subject: Follow up r65500 : invalidate Title protection cache. X-Git-Tag: 1.31.0-rc.0~34022 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=6a387303293f011c01a75dca8427e237943ce7d7;p=lhc%2Fweb%2Fwiklou.git Follow up r65500 : invalidate Title protection cache. --- diff --git a/includes/Title.php b/includes/Title.php index bddc6cc09f..0909cfde6b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1602,6 +1602,10 @@ class Title { return $this->mTitleProtection; } + private function invalidateTitleProtectionCache() { + unset( $this->mTitleProtection ); + } + /** * Update the title protection status * @@ -1650,6 +1654,8 @@ class Title { $dbw->delete( 'protected_titles', array( 'pt_namespace' => $namespace, 'pt_title' => $title ), __METHOD__ ); } + $this->invalidateTitleProtectionCache(); + # Update the protection log if ( $dbw->affectedRows() ) { $log = new LogPage( 'protect' ); @@ -1676,6 +1682,7 @@ class Title { array( 'pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBkey() ), __METHOD__ ); + $this->invalidateTitleProtectionCache(); } /** @@ -2058,6 +2065,7 @@ class Title { } if ( $purgeExpired ) { Title::purgeExpiredRestrictions(); + $this->invalidateTitleProtectionCache(); } wfProfileOut( __METHOD__ ); @@ -2177,6 +2185,7 @@ class Title { if ( $purgeExpired ) { Title::purgeExpiredRestrictions(); + $this->invalidateTitleProtectionCache(); } } @@ -2211,6 +2220,7 @@ class Title { $this->mRestrictions['create'] = explode( ',', trim( $title_protection['pt_create_perm'] ) ); } else { // Get rid of the old restrictions Title::purgeExpiredRestrictions(); + $this->invalidateTitleProtectionCache(); } } else { $this->mRestrictionsExpiry['create'] = Block::decodeExpiry( '' );