mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 04:12:18 +09:00
Fix compatibility with code that uses lang arrays as objects
This commit is contained in:
parent
b6fa7f825b
commit
497d3f2d22
1 changed files with 16 additions and 2 deletions
|
|
@ -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};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue