diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-01-30 21:52:22 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-01-30 21:52:22 +0100 |
commit | 72d61337496738d276d7671f0e07f201713aec6a (patch) | |
tree | cdc7c48e4450ec6e8c85efdffa06f1e466c15c13 /system | |
parent | afc7fd52389adf43756e1083fe854ce0da61710f (diff) |
Fixed bug #1813 - added check for $CI->db isset() and is_object() before returning false in Loader::database()
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Loader.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index a59d6e38e..576cb11f3 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -193,8 +193,11 @@ class CI_Loader { */
function database($params = '', $return = FALSE, $active_record = FALSE)
{
+ // Grab the super object
+ $CI =& get_instance();
+
// Do we even need to load the database class?
- if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE)
+ if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE AND isset($CI->db) AND is_object($CI->db))
{
return FALSE;
}
@@ -205,9 +208,6 @@ class CI_Loader { {
return DB($params, $active_record);
}
-
- // Grab the super object
- $CI =& get_instance();
// Initialize the db variable. Needed to prevent
// reference errors with some configurations
|