summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-20 22:17:28 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-20 22:17:28 +0100
commit342bb7ed0396911a0c1296ce47144c6fa276b3d4 (patch)
tree93d23d4a7db49b5f50a5f1bd1b52a4a32442bdbe
parent3a5efc291ac17a8a9886be25f6b430796969d154 (diff)
Fix #1996
-rw-r--r--system/database/DB_driver.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 9fcea39b6..2d5b91541 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1605,18 +1605,21 @@ abstract class CI_DB_driver {
$trace = debug_backtrace();
foreach ($trace as $call)
{
- // We'll need this on Windows, as APPPATH and BASEPATH will always use forward slashes
- if (DIRECTORY_SEPARATOR !== '/')
+ if (isset($call['file'], $call['class']))
{
- $call['file'] = str_replace('\\', '/', $call['file']);
- }
+ // We'll need this on Windows, as APPPATH and BASEPATH will always use forward slashes
+ if (DIRECTORY_SEPARATOR !== '/')
+ {
+ $call['file'] = str_replace('\\', '/', $call['file']);
+ }
- if (isset($call['file'], $call['class']) && strpos($call['file'], BASEPATH.'database') === FALSE && strpos($call['class'], 'Loader') !== FALSE)
- {
- // Found it - use a relative path for safety
- $message[] = 'Filename: '.str_replace(array(APPPATH, BASEPATH), '', $call['file']);
- $message[] = 'Line Number: '.$call['line'];
- break;
+ if (strpos($call['file'], BASEPATH.'database') === FALSE && strpos($call['class'], 'Loader') === FALSE)
+ {
+ // Found it - use a relative path for safety
+ $message[] = 'Filename: '.str_replace(array(APPPATH, BASEPATH), '', $call['file']);
+ $message[] = 'Line Number: '.$call['line'];
+ break;
+ }
}
}