summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2010-08-31 16:42:43 +0200
committerDerek Jones <derek.jones@ellislab.com>2010-08-31 16:42:43 +0200
commitb1e973247b66e0f4dc576484add50c2ebe10125a (patch)
tree9c80207be0914599ee04dc0db80d4c957c1192c2 /system
parent95b183addfb1683583d401e04f2684ceb86f8b96 (diff)
parent7284f06585a689702ea86684893c999065621460 (diff)
Automated merge with http://hg.ellislab.com/CodeIgniter2
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_driver.php18
-rw-r--r--system/libraries/Encrypt.php2
-rw-r--r--system/libraries/Session.php5
3 files changed, 24 insertions, 1 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index dfef42757..8e6f88801 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1169,6 +1169,24 @@ class CI_DB_driver {
$message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error;
}
+ // Find the most likely culprit of the error by going through
+ // the backtrace until the source file is no longer in the
+ // database folder.
+
+ $trace = debug_backtrace();
+
+ foreach($trace as $call)
+ {
+ if (isset($call['file']) && strpos($call['file'], BASEPATH.'database') === FALSE)
+ {
+ // Found it - use a relative path for safety
+ $message[] = 'Filename: '.str_replace(array(BASEPATH, APPPATH), '', $call['file']);
+ $message[] = 'Line Number: '.$call['line'];
+
+ break;
+ }
+ }
+
$error =& load_class('Exceptions', 'core');
echo $error->show_error($heading, $message, 'error_db');
exit;
diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php
index c893fbf9e..44fdce03b 100644
--- a/system/libraries/Encrypt.php
+++ b/system/libraries/Encrypt.php
@@ -72,7 +72,7 @@ class CI_Encrypt {
$CI =& get_instance();
$key = $CI->config->item('encryption_key');
- if ($key === FALSE)
+ if ($key == FALSE)
{
show_error('In order to use the encryption class requires that you set an encryption key in your config file.');
}
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index cf6dc96e3..f413c0d1b 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -65,6 +65,11 @@ class CI_Session {
$this->$key = (isset($params[$key])) ? $params[$key] : $this->CI->config->item($key);
}
+ if ($this->encryption_key == '')
+ {
+ show_error('In order to use the Session class you are required to set an encryption key in your config file.');
+ }
+
// Load the string helper so we can use the strip_slashes() function
$this->CI->load->helper('string');