Skip to content

Commit

Permalink
strict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 8, 2020
1 parent 662a612 commit f6dc6af
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Tracy/BlueScreen/BlueScreen.php
Expand Up @@ -244,13 +244,14 @@ private function renderActions(\Throwable $ex): array
public static function highlightFile(string $file, int $line, int $lines = 15, array $vars = [], array $keysToHide = []): ?string
{
$source = @file_get_contents($file); // @ file may not exist
if ($source) {
$source = static::highlightPhp($source, $line, $lines, $vars, $keysToHide);
if ($editor = Helpers::editorUri($file, $line)) {
$source = substr_replace($source, ' data-tracy-href="' . Helpers::escapeHtml($editor) . '"', 4, 0);
}
return $source;
if ($source === false) {
return null;
}
$source = static::highlightPhp($source, $line, $lines, $vars, $keysToHide);
if ($editor = Helpers::editorUri($file, $line)) {
$source = substr_replace($source, ' data-tracy-href="' . Helpers::escapeHtml($editor) . '"', 4, 0);
}
return $source;
}


Expand Down

0 comments on commit f6dc6af

Please sign in to comment.