X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTitle.php;h=f6e59122e534c4573bd64416dacc7f86a6358fa5;hb=138298b397b308ad6e4bfc7088884d90e8ac1e37;hp=9711749d33a276c1a97f88ede8416395829a5ed7;hpb=966e34619bef0b2dd1e275565829ed2030edd564;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index 9711749d33..f6e59122e5 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -979,7 +979,7 @@ class Title implements LinkTarget { && ( !$this->mContentModel || $flags === self::GAID_FOR_UPDATE ) && $this->getArticleID( $flags ) ) { - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->addLinkObj( $this ); # in case we already had an article ID $this->mContentModel = $linkCache->getGoodLinkFieldObj( $this, 'model' ); } @@ -2553,7 +2553,10 @@ class Title implements LinkTarget { return $errors; } - if ( $wgEmailConfirmToEdit && !$user->isEmailConfirmed() ) { + if ( $wgEmailConfirmToEdit + && !$user->isEmailConfirmed() + && $action === 'edit' + ) { $errors[] = [ 'confirmedittext' ]; } @@ -3430,7 +3433,7 @@ class Title implements LinkTarget { $this->mArticleID = 0; return $this->mArticleID; } - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); if ( $flags & self::GAID_FOR_UPDATE ) { $oldUpdate = $linkCache->forUpdate( true ); $linkCache->clearLink( $this ); @@ -3460,7 +3463,7 @@ class Title implements LinkTarget { return $this->mRedirect; } - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->addLinkObj( $this ); # in case we already had an article ID $cached = $linkCache->getGoodLinkFieldObj( $this, 'redirect' ); if ( $cached === null ) { @@ -3494,7 +3497,7 @@ class Title implements LinkTarget { $this->mLength = 0; return $this->mLength; } - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->addLinkObj( $this ); # in case we already had an article ID $cached = $linkCache->getGoodLinkFieldObj( $this, 'length' ); if ( $cached === null ) { @@ -3522,7 +3525,7 @@ class Title implements LinkTarget { $this->mLatestID = 0; return $this->mLatestID; } - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->addLinkObj( $this ); # in case we already had an article ID $cached = $linkCache->getGoodLinkFieldObj( $this, 'revision' ); if ( $cached === null ) { @@ -3547,7 +3550,7 @@ class Title implements LinkTarget { * @param int $newid The new Article ID */ public function resetArticleID( $newid ) { - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->clearLink( $this ); if ( $newid === false ) { @@ -3569,7 +3572,7 @@ class Title implements LinkTarget { } public static function clearCaches() { - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->clear(); $titleCache = self::getTitleCache(); @@ -3673,7 +3676,7 @@ class Title implements LinkTarget { $retVal = []; if ( $res->numRows() ) { - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); foreach ( $res as $row ) { $titleObj = self::makeTitle( $row->page_namespace, $row->page_title ); if ( $titleObj ) { @@ -3741,7 +3744,7 @@ class Title implements LinkTarget { ); $retVal = []; - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); foreach ( $res as $row ) { if ( $row->page_id ) { $titleObj = self::newFromRow( $row ); @@ -4940,7 +4943,7 @@ class Title implements LinkTarget { // check, if the page language could be saved in the database, and if so and // the value is not requested already, lookup the page language using LinkCache if ( $wgPageLanguageUseDB && $this->mDbPageLanguage === false ) { - $linkCache = LinkCache::singleton(); + $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->addLinkObj( $this ); $this->mDbPageLanguage = $linkCache->getGoodLinkFieldObj( $this, 'lang' ); } @@ -4980,7 +4983,7 @@ class Title implements LinkTarget { $langObj = $contentHandler->getPageLanguage( $this ); $this->mPageLanguage = [ $langObj->getCode(), $wgLanguageCode ]; } else { - $langObj = wfGetLangObj( $this->mPageLanguage[0] ); + $langObj = Language::factory( $this->mPageLanguage[0] ); } return $langObj;