Fix caching of nl_langInfo() calls
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 11 Jul 2009 19:38:01 +0000 (15:38 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 11 Jul 2009 19:38:01 +0000 (15:38 -0400)
framework/Nls/lib/Horde/Nls.php

index d2f783d..3b3ed92 100644 (file)
@@ -465,10 +465,12 @@ class Horde_Nls
         }
 
         if (!isset(self::$_cache['nl_info'])) {
-            self::$_cache['nl_info'] = nl_langinfo($item);
+            self::$_cache['nl_info'] = array();
         }
-
-        return self::$_cache['nl_info'];
+        if (!isset(self::$_cache['nl_info'][$item])) {
+            self::$_cache['nl_info'][$item] = nl_langinfo($item);
+        }
+        return self::$_cache['nl_info'][$item];
     }
 
     /**