From 497d3f2d22001b2fa761a51cf17f3d980e9f908e Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 5 Feb 2016 15:39:55 +0900 Subject: [PATCH] Fix compatibility with code that uses lang arrays as objects --- common/framework/lang.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/common/framework/lang.php b/common/framework/lang.php index be08f391c..792708fba 100644 --- a/common/framework/lang.php +++ b/common/framework/lang.php @@ -304,7 +304,14 @@ class Lang // Search custom translations first. if (isset($this->_loaded_plugins['_custom_']->{$key})) { - return $this->_loaded_plugins['_custom_']->{$key}; + if (is_array($this->_loaded_plugins['_custom_']->{$key})) + { + return new \ArrayObject($this->_loaded_plugins['_custom_']->{$key}, 3); + } + else + { + return $this->_loaded_plugins['_custom_']->{$key}; + } } // Search other plugins. @@ -312,7 +319,14 @@ class Lang { if (isset($this->_loaded_plugins[$plugin_name]->{$key})) { - return $this->_loaded_plugins[$plugin_name]->{$key}; + if (is_array($this->_loaded_plugins[$plugin_name]->{$key})) + { + return new \ArrayObject($this->_loaded_plugins[$plugin_name]->{$key}, 3); + } + else + { + return $this->_loaded_plugins[$plugin_name]->{$key}; + } } }