diff options
author | Timothy Warren <tim@timshomepage.net> | 2012-04-27 15:58:11 +0200 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2012-04-27 15:58:11 +0200 |
commit | 7183ff91112e540315dffdef2cea0d6d491cdc2e (patch) | |
tree | 71119fbf7069a35abf1e1ad8eaa6e49ba16afecb | |
parent | b82bc3a016ce01dfeb993da5918853625a40af86 (diff) | |
parent | 8a6d16c62602d249d2e66356faf5e2f4b8470c9e (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into library-cleanup
-rwxr-xr-x | system/core/Input.php | 1 | ||||
-rwxr-xr-x | system/core/Lang.php | 26 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
3 files changed, 17 insertions, 11 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index fc2a550bc..7594a2e45 100755 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -226,6 +226,7 @@ class CI_Input { */ public function cookie($index = '', $xss_clean = FALSE) { + $index = config_item('cookie_prefix').$index; return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); } diff --git a/system/core/Lang.php b/system/core/Lang.php index 2963012fc..5cb0cad71 100755 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -42,7 +42,7 @@ class CI_Lang { * @var array */ public $language = array(); - + /** * List of loaded language files * @@ -52,6 +52,8 @@ class CI_Lang { /** * Initialize language class + * + * @return void */ public function __construct() { @@ -76,22 +78,20 @@ class CI_Lang { if ($add_suffix == TRUE) { - $langfile = str_replace('_lang.', '', $langfile).'_lang'; + $langfile = str_replace('_lang', '', $langfile).'_lang'; } $langfile .= '.php'; - if (in_array($langfile, $this->is_loaded, TRUE)) + if ($idiom == '') { - return; + $config =& get_config(); + $idiom = ( ! empty($config['language'])) ? $config['language'] : 'english'; } - $config =& get_config(); - - if ($idiom == '') + if ($return == FALSE && isset($this->is_loaded[$langfile]) && $this->is_loaded[$langfile] === $idiom) { - $deft_lang = ( ! isset($config['language'])) ? 'english' : $config['language']; - $idiom = ($deft_lang == '') ? 'english' : $deft_lang; + return; } // Determine where the language file is and load it @@ -123,6 +123,11 @@ class CI_Lang { if ( ! isset($lang) OR ! is_array($lang)) { log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); + + if ($return == TRUE) + { + return array(); + } return; } @@ -131,9 +136,8 @@ class CI_Lang { return $lang; } - $this->is_loaded[] = $langfile; + $this->is_loaded[$langfile] = $idiom; $this->language = array_merge($this->language, $lang); - unset($lang); log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); return TRUE; diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 03a020a45..bdb418f86 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -213,6 +213,7 @@ Bug fixes for 3.0 - Fixed a bug in Oracle's and MSSQL's delete() methods where an erroneous SQL statement was generated when used with limit(). - Fixed a bug in SQLSRV's delete() method where like() and limit() conditions were ignored. - Fixed a bug (#1265) - Database connections were always closed, regardless of the 'pconnect' option value. +- Fixed a bug (#128) - :doc:`Language Library <libraries/language>` did not correctly keep track of loaded language files. Version 2.1.1 ============= |