Merge branch '2.7' into 2.8
* 2.7: [HttpKernel] Fix test Remove port from default host in server:status command [Console] Escape exception messages
This commit is contained in:
commit
a0e654d981
@ -32,7 +32,7 @@ class ServerStatusCommand extends ServerCommand
|
||||
{
|
||||
$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')
|
||||
|
@ -14,6 +14,7 @@ namespace Symfony\Component\Console;
|
||||
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;
|
||||
@ -654,7 +655,7 @@ class Application
|
||||
}
|
||||
$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;
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
|
||||
[Exception]
|
||||
Third exception comment
|
||||
Third exception <fg=blue;bg=red>comment</>
|
||||
|
||||
|
||||
|
||||
[Exception]
|
||||
Second exception comment
|
||||
Second exception <comment>comment</comment>
|
||||
|
||||
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
|
||||
[37;41m [39;49m
|
||||
[37;41m [Exception] [39;49m
|
||||
[37;41m Third exception [39;49m[34;41mcomment[39;49m[37;41m [39;49m
|
||||
[37;41m [39;49m
|
||||
[37;41m [39;49m
|
||||
[37;41m [Exception] [39;49m
|
||||
[37;41m Third exception <fg=blue;bg=red>comment</> [39;49m
|
||||
[37;41m [39;49m
|
||||
|
||||
[37;41m [39;49m
|
||||
[37;41m [Exception] [39;49m
|
||||
[37;41m Second exception [39;49m[33mcomment[39m[37;41m [39;49m
|
||||
[37;41m [39;49m
|
||||
[37;41m [39;49m
|
||||
[37;41m [Exception] [39;49m
|
||||
[37;41m Second exception <comment>comment</comment> [39;49m
|
||||
[37;41m [39;49m
|
||||
|
||||
[37;41m [39;49m
|
||||
[37;41m [Exception] [39;49m
|
||||
[37;41m First exception [39;49m[37;41m<p>[39;49m[37;41mthis is html[39;49m[37;41m</p>[39;49m[37;41m [39;49m
|
||||
[37;41m First exception <p>this is html</p> [39;49m
|
||||
[37;41m [39;49m
|
||||
|
||||
[32mfoo3:bar[39m
|
||||
|
Reference in New Issue
Block a user