I noticed a bug in the method display_error() whilst looking for a way to generate neat error messages using the display_error() method.
I figured the best way to do this way to look how codeigniter handles errors itself.
I noticed that the backtrace is being evaluated to check which file and line-number is the culprit for the error, but I also noticed that database errors always show me the DB_driver.php class with line-number 330.
This shouldn't be the error found according to the condition:
isset($call['file']) && strpos($call['file'], BASEPATH.'database') === FALSE //line 1180
I found that the method strpos($call['file'], BASEPATH.'database') always returns false on the first call of the trace because $call['file'] and BASEPATH are formatted differently.
whilst print_r(BASEPATH) returns
This is a slashes vs backslashes issue...
replacing line 1180 by...
if (isset($call['file']) && strpos($call['file'], FCPATH.SYSDIR.'\'.'database') === FALSE)
seems to do the trick. It now shows the file causing the error...
Could you send a pull request?
I'm quite new to git, but I'll try. ;)
I've made a pull request according to a github guide, but I accidentally duplicated the issue...
The other issue is issue #1693
Pull requests automatically create issues.
Fix issue #1692