Skip to content

Commit c0aea0f

Browse files
Merge branch '4.1'
* 4.1: (23 commits) [Routing] fix trailing slash redirection when using RedirectableUrlMatcher [PropertyAccessor] fix encoding of cache keys [WebProfiler] Detect empty file paths in file viewer fixed CS Changes for upcoming Travis' infra migration Doc fix: clarify isMethodCacheable() returns true only for GET & HEAD [MonologBridge] Return empty list for unknonwn requests [DomCrawler] exclude fields inside "template" tags Use XLIFF source rather than resname when there's no target [DoctrineBridge] catch errors while converting to db values in data collector [DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider [EventDispatcher] Unwrap wrapped listeners internally [Routing] fix trailing slash redirection when using RedirectableUrlMatcher Removed the return type phpdoc fix authorization checker variable name [Routing] Remove duplicate schemes and methods for invokable controllers Indentation error [HttpFoundation] Fix trailing space for mime-type with parameters [HttpFoundation] Fixed absolute Request URI with default port [Bridge/PhpUnit] fix the fix ...
2 parents fdad8d2 + 512f8af commit c0aea0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Extension/CodeExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function formatArgsAsText($args)
135135
*/
136136
public function fileExcerpt($file, $line, $srcContext = 3)
137137
{
138-
if (is_readable($file)) {
138+
if (is_file($file) && is_readable($file)) {
139139
// highlight_file could throw warnings
140140
// see https://bugs.php.net/bug.php?id=25725
141141
$code = @highlight_file($file, true);
@@ -158,6 +158,8 @@ public function fileExcerpt($file, $line, $srcContext = 3)
158158

159159
return '<ol start="'.max($line - $srcContext, 1).'">'.implode("\n", $lines).'</ol>';
160160
}
161+
162+
return null;
161163
}
162164

163165
/**

0 commit comments

Comments
 (0)