8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af7f75f commit 773d818Copy full SHA for 773d818
src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php
@@ -143,6 +143,13 @@ public function formatArgs(array $args)
143
public function fileExcerpt($file, $line)
144
{
145
if (is_readable($file)) {
146
+ if (extension_loaded('fileinfo')) {
147
+ $finfo = new \Finfo();
148
+ if ('application/octet-stream' === $finfo->file($file, FILEINFO_MIME_TYPE)) {
149
+ return;
150
+ }
151
152
+
153
$code = highlight_file($file, true);
154
// remove main code/span tags
155
$code = preg_replace('#^<code.*?>\s*<span.*?>(.*)</span>\s*</code>#s', '\\1', $code);
0 commit comments