diff options
author | Daniel Hunsaker <danhunsaker@gmail.com> | 2013-02-22 21:49:33 +0100 |
---|---|---|
committer | Daniel Hunsaker <danhunsaker@gmail.com> | 2013-02-22 21:49:33 +0100 |
commit | 44a6d1da2be916fe0f23a3ea4d5fcb391d7f65dd (patch) | |
tree | 31549ebf6ea5ea98e4347eb640d1caa685316f3e /system/helpers/smiley_helper.php | |
parent | 353f9834adf3f44c6c7a0f924089bb2b43360404 (diff) | |
parent | eb291c1d1e1116a4420fa30e587adeea0451eeb7 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/exit-status
Diffstat (limited to 'system/helpers/smiley_helper.php')
-rw-r--r-- | system/helpers/smiley_helper.php | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 186b24ce9..d9a693493 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -213,16 +213,30 @@ if ( ! function_exists('_get_smiley_array')) */ function _get_smiley_array() { - if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) - { - include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); - } - elseif (file_exists(APPPATH.'config/smileys.php')) + static $_smileys; + + if ( ! is_array($smileys)) { - include(APPPATH.'config/smileys.php'); + if (file_exists(APPPATH.'config/smileys.php')) + { + include(APPPATH.'config/smileys.php'); + } + + if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) + { + include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); + } + + if (empty($smileys) OR ! is_array($smileys)) + { + $_smileys = array(); + return FALSE; + } + + $_smileys = $smileys; } - return (isset($smileys) && is_array($smileys)) ? $smileys : FALSE; + return $_smileys; } } |