diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-01-23 15:46:01 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-01-23 15:46:01 -0800 |
commit | c9b775c21abdf157b635ee023100f25488b89a03 (patch) | |
tree | c3576285c22034e35417d2b2fdfda6a196688dae | |
parent | a1a3d4f59568dc7de2b309796752a49242fde6f0 (diff) |
Fix for bug 984, consistently interpret installed / available locales as array.
On the current hostgater setup (PHP 5.2.12), locales::available() was returning an array and isset($locales->$code) would always (silently) return false.
Choosing array over stdClass since count($someStdClass) will always return 1, and not the number of object members.
-rw-r--r-- | modules/gallery/helpers/locales.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index 8d76e333..5c8c227a 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -41,7 +41,7 @@ class locales_Core { $default = module::get_var("gallery", "default_locale"); $codes = explode("|", module::get_var("gallery", "installed_locales", $default)); foreach ($codes as $code) { - if (isset($available->$code)) { + if (isset($available[$code])) { $installed[$code] = $available[$code]; } } @@ -127,7 +127,7 @@ class locales_Core { } $locale or $locale = Gallery_I18n::instance()->locale(); - return self::$locales["$locale"]; + return self::$locales[$locale]; } static function is_rtl($locale=null) { |