Browse Source

Merge pull request #4630 from cakephp/3.0-debug

Avoid notice thrown in debug().
Mark Story 11 years ago
parent
commit
cca12c5563
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/basics.php

+ 5 - 1
src/basics.php

@@ -52,7 +52,11 @@ if (!function_exists('debug')) {
 		$lineInfo = '';
 		if ($showFrom) {
 			$trace = Debugger::trace(array('start' => 1, 'depth' => 2, 'format' => 'array'));
-			$file = str_replace(array(CAKE_CORE_INCLUDE_PATH, ROOT), '', $trace[0]['file']);
+			$search = array(ROOT);
+			if (defined('CAKE_CORE_INCLUDE_PATH')) {
+				array_unshift($search, CAKE_CORE_INCLUDE_PATH);
+			}
+			$file = str_replace($search, '', $trace[0]['file']);
 			$line = $trace[0]['line'];
 		}
 		$html = <<<HTML