8000 Merge branch '3.2' · symfony/symfony@d5af0da · GitHub
[go: up one dir, main page]

Skip to content

Commit d5af0da

Browse files
Merge branch '3.2'
* 3.2: [Console] Fix test [HttpKernel] Fix test Remove port from default host in server:status command [Console] Escape exception messages
2 parents 9ca3f23 + 56d4769 commit d5af0da

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Console;
1313

1414
use Symfony\Component\Console\Exception\ExceptionInterface;
15+
use Symfony\Component\Console\Formatter\OutputFormatter;
1516
use Symfony\Component\Console\Helper\DebugFormatterHelper;
1617
use Symfony\Component\Console\Helper\ProcessHelper;
1718
use Symfony\Component\Console\Helper\QuestionHelper;
@@ -673,7 +674,7 @@ public function renderException(\Exception $e, OutputInterface $output)
673674
}
674675
$formatter = $output->getFormatter();
675676
$lines = array();
676-
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
677+
foreach (preg_split('/\r?\n/', OutputFormatter::escape($e->getMessage())) as $line) {
677678
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
678679
// pre-format lines to get the right string length
679680
$lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4;

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

2-
3-
[Exception]
4-
Third exception comment
5-
2+
3+
[Exception]
4+
Third exception <fg=blue;bg=red>comment</>
5+
66

7-
8-
[Exception]
9-
Second exception comment
10-
7+
8+
[Exception]
9+
Second exception <comment>comment</comment>
10+
1111

1212

1313
[Exception]

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

2-
 
3-
 [Exception] 
4-
 Third exception comment 
5-
 
2+
 
3+
 [Exception] 
4+
 Third exception <fg=blue;bg=red>comment</> 
5+
 
66

7-
 
8-
 [Exception] 
9-
 Second exception comment 
10-
 
7+
 
8+
 [Exception] 
9+
 Second exception <comment>comment</comment> 
10+
 
1111

1212
 
1313
 [Exception] 
14-
 First exception <p>this is html</p> 
14+
 First exception <p>this is html</p> 
1515
 
1616

1717
foo3:bar

0 commit comments

Comments
 (0)
0