From: Alexandre Emsenhuber Date: Wed, 1 Jan 2014 16:17:50 +0000 (+0100) Subject: Fix bad usage of empty() function X-Git-Tag: 1.31.0-rc.0~17420^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=924479c75c43141862f61f901d1f468abc0cde2f;p=lhc%2Fweb%2Fwiklou.git Fix bad usage of empty() function Use a strict comparison to null since this member variable is always defined. Change-Id: Ida7d7ecb2d65458b7f93daa886b3c2b319ffc07e --- diff --git a/includes/Title.php b/includes/Title.php index 5ab9e94d6d..7b3eb71aa5 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -73,7 +73,7 @@ class Title { var $mHasCascadingRestrictions; ///< Are cascading restrictions in effect on this page? var $mCascadeSources; ///< Where are the cascading restrictions coming from on this page? var $mRestrictionsLoaded = false; ///< Boolean for initialisation on demand - var $mPrefixedText; ///< Text form including namespace/interwiki, initialised on demand + var $mPrefixedText = null; ///< Text form including namespace/interwiki, initialised on demand var $mTitleProtection; ///< Cached value for getTitleProtection (create protection) # Don't change the following default, NS_MAIN is hardcoded in several # places. See bug 696. @@ -1265,8 +1265,7 @@ class Title { * @return String the prefixed title, with spaces */ public function getPrefixedText() { - // @todo FIXME: Bad usage of empty() ? - if ( empty( $this->mPrefixedText ) ) { + if ( $this->mPrefixedText === null ) { $s = $this->prefix( $this->mTextform ); $s = str_replace( '_', ' ', $s ); $this->mPrefixedText = $s;