8000 [FrameworkBundle] tweaked regexp · dpb587/symfony@b68624a · GitHub
[go: up one dir, main page]

Skip to content

Commit b68624a

Browse files
committed
[FrameworkBundle] tweaked regexp
1 parent d95a743 commit b68624a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function formatFile($file, $line, $text = null)
169169
$fileStr = sprintf('<abbr title="%s">kernel.root_dir</abbr>/%s', $this->rootDir, $fileStr);
170170
}
171171

172-
$text = "$fileStr line $line";
172+
$text = "$fileStr at line $line";
173173
}
174174

175175
if (false !== $link = $this->getFileLink($file, $line)) {
@@ -196,8 +196,8 @@ public function formatFileFromText($text)
196196
{
197197
$that = $this;
198198

199-
return preg_replace_callback('/in (.*?)(?: on|at)? line (\d+)/', function ($match) use ($that) {
200-
return 'in '.$that->formatFile($match[1], $match[2]);
199+
return preg_replace_callback('/in (")?(.*?)\1(?: +(?:on|at))? +line (\d+)/', function ($match) use ($that) {
200+
return 'in '.$that->formatFile($match[2], $match[3]);
201201
}, $text);
202202
}
203203

0 commit comments

Comments
 (0)
0