summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-05 16:05:46 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-05 16:05:46 +0200
commit1194ad733135214e9905123258df3600b01735fd (patch)
tree8d0347ef226e91984ba3cdab6a2937832045c497 /system/database
parent489cf769f2f7a4ffe0362e44bc83fdec14c3ac13 (diff)
Fix issue #1692
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_driver.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index b64b977cb..acba9c187 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1348,7 +1348,7 @@ abstract class CI_DB_driver {
}
else
{
- $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error;
+ $message = is_array($error) ? $error : array(str_replace('%s', $swap, $LANG->line($error)));
}
// Find the most likely culprit of the error by going through
@@ -1357,7 +1357,13 @@ abstract class CI_DB_driver {
$trace = debug_backtrace();
foreach ($trace as $call)
{
- if (isset($call['file'], $call['class']) && strpos($call['file'], BASEPATH.'database') === FALSE && strpos($call['class'], 'Loader') !== FALSE)
+ // 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']);