Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
* 2.7:
  [HttpKernel] Fix test
  Remove port from default host in server:status command
  [Console] Escape exception messages
  • Loading branch information
nicolas-grekas committed Mar 27, 2017
2 parents d175340 + dd37126 commit a0e654d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
Expand Up @@ -32,7 +32,7 @@ protected function configure()
{
$this
->setDefinition(array(
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1:8000'),
new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', '127.0.0.1'),
new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
))
->setName('server:status')
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Component/Console/Application.php
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Descriptor\TextDescriptor;
use Symfony\Component\Console\Descriptor\XmlDescriptor;
use Symfony\Component\Console\Exception\ExceptionInterface;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Helper\DebugFormatterHelper;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Console\Helper\QuestionHelper;
Expand Down Expand Up @@ -654,7 +655,7 @@ public function renderException($e, $output)
}
$formatter = $output->getFormatter();
$lines = array();
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
foreach (preg_split('/\r?\n/', OutputFormatter::escape($e->getMessage())) as $line) {
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
// pre-format lines to get the right string length
$lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4;
Expand Down
@@ -1,13 +1,13 @@


[Exception]
Third exception comment

[Exception]
Third exception <fg=blue;bg=red>comment</>


[Exception]
Second exception comment

[Exception]
Second exception <comment>comment</comment>


[Exception]
Expand Down
@@ -1,17 +1,17 @@

 
 [Exception] 
 Third exception comment 
 
 
 [Exception] 
 Third exception <fg=blue;bg=red>comment</> 
 

 
 [Exception] 
 Second exception comment 
 
 
 [Exception] 
 Second exception <comment>comment</comment> 
 

 
 [Exception] 
 First exception <p>this is html</p> 
 First exception <p>this is html</p> 
 

foo3:bar
Expand Down

0 comments on commit a0e654d

Please sign in to comment.