Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Nov 20, 2012
1 parent 36ff02b commit 4420c29
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions system/database/DB_driver.php
Expand Up @@ -1605,18 +1605,21 @@ public function display_error($error = '', $swap = '', $native = FALSE)
$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;
}
}
}

Expand Down

0 comments on commit 4420c29

Please sign in to comment.