From 924479c75c43141862f61f901d1f468abc0cde2f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 1 Jan 2014 17:17:50 +0100 Subject: [PATCH] Fix bad usage of empty() function Use a strict comparison to null since this member variable is always defined. Change-Id: Ida7d7ecb2d65458b7f93daa886b3c2b319ffc07e --- includes/Title.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.20.1