(bug 20837) Don't give a PHP notice when getSubitem() calls loadSubitem() which cause...
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 6 Jan 2010 04:08:59 +0000 (04:08 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 6 Jan 2010 04:08:59 +0000 (04:08 +0000)
includes/LocalisationCache.php

index 6ff286f..efe5ab8 100644 (file)
@@ -218,20 +218,18 @@ class LocalisationCache {
                if ( isset( $this->legacyData[$code][$key][$subkey] ) ) {
                        return $this->legacyData[$code][$key][$subkey];
                }
-               if ( !isset( $this->loadedSubitems[$code][$key][$subkey] ) ) {
-                       if ( isset( $this->loadedItems[$code][$key] ) ) {
-                               if ( isset( $this->data[$code][$key][$subkey] ) ) {
-                                       return $this->data[$code][$key][$subkey];
-                               } else {
-                                       return null;
-                               }
-                       } else {
-                               wfProfileIn( __METHOD__.'-load' );
-                               $this->loadSubitem( $code, $key, $subkey );
-                               wfProfileOut( __METHOD__.'-load' );
-                       }
+               if ( !isset( $this->loadedSubitems[$code][$key][$subkey] ) 
+                       && !isset( $this->loadedItems[$code][$key] ) ) 
+               {
+                       wfProfileIn( __METHOD__.'-load' );
+                       $this->loadSubitem( $code, $key, $subkey );
+                       wfProfileOut( __METHOD__.'-load' );
+               }
+               if ( isset( $this->data[$code][$key][$subkey] ) ) {
+                       return $this->data[$code][$key][$subkey];
+               } else {
+                       return null;
                }
-               return $this->data[$code][$key][$subkey];
        }
 
        /**