From 794d41a31cefb839c7b5e0c214333218a83b27bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Wed, 28 Nov 2007 15:09:36 +0000 Subject: [PATCH] * Optimization in Title::isAlwaysKnown --- includes/Title.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index e3c4c941d5..567e18acaa 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2635,9 +2635,15 @@ class Title { * @return bool */ public function isAlwaysKnown() { + // If the page is form Mediawiki:message/lang, calling wfMsgWeirdKey causes + // the full l10n of that language to be loaded. That takes much memory and + // isn't needed. So we strip the language part away. + // Also, extension messages which are not loaded, are shown as red, because + // we don't call MessageCache::loadAllMessages. + list( $basename, /* rest */ ) = explode( '/', $this->mDbkeyform, 2 ); return $this->isExternal() || ( $this->mNamespace == NS_MAIN && $this->mDbkeyform == '' ) - || ( $this->mNamespace == NS_MEDIAWIKI && wfMsgWeirdKey( $this->mDbkeyform ) ); + || ( $this->mNamespace == NS_MEDIAWIKI && wfMsgWeirdKey( $basename ) ); } /** -- 2.20.1