bug #30976 [Debug] Fixed error handling when an error is already handled when another error is already handled (5) (lyrixx)

This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Fixed error handling when an error is already handled when another error is already handled (5)

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

---

Please, don't ask how to reproduce it :)

Commits
-------

a36c7315f4 [Debug] Fixed error handling when an error is already handled when another error is already handled (5)
This commit is contained in:
Fabien Potencier 2019-04-07 15:50:27 +02:00
commit cd54e0f232
1 changed files with 6 additions and 2 deletions

View File

@ -372,7 +372,7 @@ EOF;
$fmt = $this->fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
if (!$fmt) {
return sprintf('<span class="block trace-file-path">in <a title="%s%3$s"><strong>%s</strong>%s</a></span>', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : '');
return sprintf('<span class="block trace-file-path">in <span title="%s%3$s"><strong>%s</strong>%s</span></span>', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : '');
}
if (\is_string($fmt)) {
@ -388,7 +388,11 @@ EOF;
$link = strtr($fmt[0], ['%f' => $path, '%l' => $line]);
} else {
$link = $fmt->format($path, $line);
try {
$link = $fmt->format($path, $line);
} catch (\Exception $e) {
return sprintf('<span class="block trace-file-path">in <span title="%s%3$s"><strong>%s</strong>%s</span></span>', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : '');
}
}
return sprintf('<span class="block trace-file-path">in <a href="%s" title="Go to source"><strong>%s</string>%s</a></span>', $this->escapeHtml($link), $file, 0 < $line ? ' line '.$line : '');