From 123a1a21baf307b85b9ea7e78017d02d375c1a91 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 7 Dec 2011 21:19:57 -0500 Subject: [PATCH] Fix issues with stack trace output. Traces without files and without classes caused errors in printing the fancy trace. --- lib/Cake/View/Elements/exception_stack_trace.ctp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Cake/View/Elements/exception_stack_trace.ctp b/lib/Cake/View/Elements/exception_stack_trace.ctp index 6d19ff0f480..be016757a88 100644 --- a/lib/Cake/View/Elements/exception_stack_trace.ctp +++ b/lib/Cake/View/Elements/exception_stack_trace.ctp @@ -29,12 +29,14 @@ App::uses('Debugger', 'Utility'); printf( '%s line %s', $i, - $stack['file'], + Debugger::trimPath($stack['file']), $stack['line'] ); $excerpt = sprintf(' '; + else: + echo '[internal function]'; endif; echo ' → '; if ($stack['function']): @@ -43,13 +45,13 @@ App::uses('Debugger', 'Utility'); $args[] = Debugger::getType($arg); $params[] = Debugger::exportVar($arg, 2); endforeach; + + $called = isset($stack['class']) ? $stack['class'] . $stack['type'] . $stack['function'] : $stack['function']; printf( - '%s%s%s(%s) ', + '%s(%s) ', $i, - $stack['class'], - $stack['type'], - $stack['function'], + $called, implode(', ', $args) ); $arguments = sprintf('