Skip to content

Commit 919345e

Browse files
committed
Merge branch '2.5'
* 2.5: (37 commits) [Validator] Backported constraint validator tests from 2.5 [Validator] Backported constraint validator tests from 2.5 [DIC] Fixed: anonymous services are always private Fix toolbar vertical alignment. [HttpFoundation] MongoDbSessionHandler supports auto expiry via configurable expiry_field [Validator] Fix little typo in ExecutionContextInterface::buildViolation() method comments fix dependencies on HttpFoundation component [FrameworkBundle] add missing attribute to XSD Allow basic auth in url. Improve regex. Add tests. fix typos and syntax in Profiler controller method comments resolve parameters before the configs are processed add symfony/yaml suggestion to composer.json [HttpKernel] added an analyze of environment parameters for built-in server. remove volatile tests [Console] fixed style creation when providing an unknown tag option change command to which available under most unix systems add way to test command under windows fix shell command injection [Form] allowed CallbackTransformer to use callable [Process] Added process synchronization to the incremental output tests ... Conflicts: src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/HttpKernel/composer.json src/Symfony/Component/Validator/Constraints/AllValidator.php src/Symfony/Component/Validator/Constraints/CollectionValidator.php src/Symfony/Component/Validator/Constraints/LegacyAllValidator.php src/Symfony/Component/Validator/Constraints/LegacyCollectionValidator.php src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
2 parents 0c91f33 + 748beed commit 919345e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Formatter/OutputFormatter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ private function createStyleFromString($string)
215215
} elseif ('bg' == $match[0]) {
216216
$style->setBackground($match[1]);
217217
} else {
218-
$style->setOption($match[1]);
218+
try {
219+
$style->setOption($match[1]);
220+
} catch (\InvalidArgumentException $e) {
221+
return false;
222+
}
219223
}
220224
}
221225

Tests/Formatter/OutputFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function testNonStyleTag()
151151
{
152152
$formatter = new OutputFormatter(true);
153153

154-
$this->assertEquals("\033[32msome \033[39m\033[32m<tag>\033[39m\033[32m styled \033[39m\033[32m<p>\033[39m\033[32msingle-char tag\033[39m\033[32m</p>\033[39m", $formatter->format('<info>some <tag> styled <p>single-char tag</p></info>'));
154+
$this->assertEquals("\033[32msome \033[39m\033[32m<tag>\033[39m\033[32m \033[39m\033[32m<setting=value>\033[39m\033[32m styled \033[39m\033[32m<p>\033[39m\033[32msingle-char tag\033[39m\033[32m</p>\033[39m", $formatter->format('<info>some <tag> <setting=value> styled <p>single-char tag</p></info>'));
155155
}
156156

157157
public function testFormatLongString()

0 commit comments

Comments
 (0)