Suggested enhancement: Error text alteration

Permalink 1 user found helpful
As the lack of line numbers (and affected file) are missing from the Error Text, I've replaced the else clause of ($detail === 'debug') of /concrete/src/Error/Handler/ErrorHandler.php with the following:
else {
  $e = $this->getInspector()->getException();
  $estr = sprintf("File: %s<br />
                   Line: %d<br />
                   Error Text: %s"
                  ,h($e->getFile())
                  ,$e->getLine()
                  ,h($e->getMessage())
                 );
  Core::make('helper/concrete/ui')->renderError(
      t(sprintf('An unexpected PHP error (%d) occurred.',$e->getCode()))
      ,$estr
  );
}


I'm not sure the h() calls are absolutely necessary, but just in case there's any funky html tags in the error text (or somehow in the file names), this should address any security concerns. Wrapping the whole $estr parameter of the renderError call in an h() - as was in the orig. code - makes the <br>s appear as literal text in the error message.

 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi mpagel,

Have you tried enabling the debug error output?
Dashboard > System & Settings > Environment > Debug Settings > Error Detail > Show the debug error output
mpagel replied on at Permalink Reply
Heh. I don't have a dashboard login acc't, Thanks for the tip though.