From: Alexandre Emsenhuber Date: Tue, 24 Jul 2012 12:44:27 +0000 (+0200) Subject: Do checks in the correct order in Linker::getLinkColour(). X-Git-Tag: 1.31.0-rc.0~22960 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=df8c25e288cfbefc82ebf6988c7f2a88db9949da;p=lhc%2Fweb%2Fwiklou.git Do checks in the correct order in Linker::getLinkColour(). There's no point doing potentially expensive checks (exists() and getLength()) if the page is simply not in a content namespace. Change-Id: I86a2b3a36071cf508b8e99ef20bdf3e0e20f3c82 --- diff --git a/includes/Linker.php b/includes/Linker.php index 53551402fb..083845dc04 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -139,9 +139,9 @@ class Linker { if ( $t->isRedirect() ) { # Page is a redirect $colour = 'mw-redirect'; - } elseif ( $threshold > 0 && - $t->exists() && $t->getLength() < $threshold && - $t->isContentPage() ) { + } elseif ( $threshold > 0 && $t->isContentPage() && + $t->exists() && $t->getLength() < $threshold + ) { # Page is a stub $colour = 'stub'; }