diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB.php | 23 | ||||
-rw-r--r-- | system/database/drivers/mssql/mssql_result.php | 2 | ||||
-rw-r--r-- | system/libraries/Encryption.php | 4 | ||||
-rw-r--r-- | system/libraries/Session/Session.php | 3 |
4 files changed, 18 insertions, 14 deletions
diff --git a/system/database/DB.php b/system/database/DB.php index d411b679e..8ea7ca6fa 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -61,18 +61,23 @@ function &DB($params = '', $query_builder_override = NULL) } include($file_path); - // Make packages contain database config files - foreach (get_instance()->load->get_package_paths() as $path) + + // Make packages contain database config files, + // given that the controller instance already exists + if (class_exists('CI_Controller', FALSE)) { - if ($path !== APPPATH) + foreach (get_instance()->load->get_package_paths() as $path) { - if (file_exists($file_path = $path.'config/'.ENVIRONMENT.'/database.php')) - { - include($file_path); - } - elseif (file_exists($file_path = $path.'config/database.php')) + if ($path !== APPPATH) { - include($file_path); + if (file_exists($file_path = $path.'config/'.ENVIRONMENT.'/database.php')) + { + include($file_path); + } + elseif (file_exists($file_path = $path.'config/database.php')) + { + include($file_path); + } } } } diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index 8828dc9e6..c1c42a486 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -107,7 +107,7 @@ class CI_DB_mssql_result extends CI_DB_result { public function field_data() { $retval = array(); - for ($i = 0, $c = $this->num_field(); $i < $c; $i++) + for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) { $field = mssql_fetch_field($this->result_id, $i); diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php index e4c668b6d..e3e68139a 100644 --- a/system/libraries/Encryption.php +++ b/system/libraries/Encryption.php @@ -248,7 +248,7 @@ class CI_Encryption { $params['mode'] = strtolower($params['mode']); if ( ! isset($this->_modes['mcrypt'][$params['mode']])) { - log_message('error', 'Encryption: MCrypt mode '.strtotupper($params['mode']).' is not available.'); + log_message('error', 'Encryption: MCrypt mode '.strtoupper($params['mode']).' is not available.'); } else { @@ -299,7 +299,7 @@ class CI_Encryption { $params['mode'] = strtolower($params['mode']); if ( ! isset($this->_modes['openssl'][$params['mode']])) { - log_message('error', 'Encryption: OpenSSL mode '.strtotupper($params['mode']).' is not available.'); + log_message('error', 'Encryption: OpenSSL mode '.strtoupper($params['mode']).' is not available.'); } else { diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 2551e54e9..ba1919b44 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -143,8 +143,7 @@ class CI_Session { session_start(); // Is session ID auto-regeneration configured? (ignoring ajax requests) - if ( ! empty($_SERVER['HTTP_X_REQUESTED_WITH']) - && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest' + if ((empty($_SERVER['HTTP_X_REQUESTED_WITH']) OR strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') && ($regenerate_time = config_item('sess_time_to_update')) > 0 ) { |