X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTitle.php;h=e549037fac68e4fb4407bb138b5146063472be86;hb=61c7852049de45664593437f8b8335809fdbccae;hp=35d9c6bca97bd6ca11882bc6b00df824ea88027e;hpb=a780c174f7251c44d7d93827256033c6cc4991dc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index 35d9c6bca9..e549037fac 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -130,12 +130,6 @@ class Title { */ public $mDefaultNamespace = NS_MAIN; - /** - * @var bool Is $wgUser watching this page? null if unfilled, accessed - * through userIsWatching() - */ - protected $mWatched = null; - /** @var int The page length, 0 for special pages */ protected $mLength = -1; @@ -1875,25 +1869,6 @@ class Title { return $s; } - /** - * Is $wgUser watching this page? - * - * @deprecated since 1.20; use User::isWatched() instead. - * @return bool - */ - public function userIsWatching() { - global $wgUser; - - if ( is_null( $this->mWatched ) ) { - if ( NS_SPECIAL == $this->mNamespace || !$wgUser->isLoggedIn() ) { - $this->mWatched = false; - } else { - $this->mWatched = $wgUser->isWatched( $this ); - } - } - return $this->mWatched; - } - /** * Can $user perform $action on this page? * This skips potentially expensive cascading permission checks @@ -3045,20 +3020,22 @@ class Title { return; } - $method = __METHOD__; - $dbw = wfGetDB( DB_MASTER ); - $dbw->onTransactionIdle( function () use ( $dbw, $method ) { - $dbw->delete( - 'page_restrictions', - array( 'pr_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), - $method - ); - $dbw->delete( - 'protected_titles', - array( 'pt_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), - $method - ); - } ); + DeferredUpdates::addUpdate( new AtomicSectionUpdate( + wfGetDB( DB_MASTER ), + __METHOD__, + function ( IDatabase $dbw, $fname ) { + $dbw->delete( + 'page_restrictions', + array( 'pr_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), + $fname + ); + $dbw->delete( + 'protected_titles', + array( 'pt_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), + $fname + ); + } + ) ); } /** @@ -3572,7 +3549,7 @@ class Title { if ( $pageLang->hasVariants() ) { $variants = $pageLang->getVariants(); foreach ( $variants as $vCode ) { - $urls[] = $this->getInternalURL( '', $vCode ); + $urls[] = $this->getInternalURL( $vCode ); } } @@ -4654,7 +4631,7 @@ class Title { // Checking $wgLanguageCode hasn't changed for the benefit of unit // tests. $contentHandler = ContentHandler::getForTitle( $this ); - $langObj = wfGetLangObj( $contentHandler->getPageLanguage( $this ) ); + $langObj = $contentHandler->getPageLanguage( $this ); $this->mPageLanguage = array( $langObj->getCode(), $wgLanguageCode ); } else { $langObj = wfGetLangObj( $this->mPageLanguage[0] );