Skip to content

Commit 5af798a

Browse files
Merge branch '4.1' into 4.2
* 4.1: [Routing] fix trailing slash redirections involving a trailing var [EventDispatcher] Revers event tracing order [Security] Prefer clone over unserialize(serialize()) for user refreshment [Console] OutputFormatter: move strtolower to createStyleFromString Adjust tests to work in the armhf architecture. Fixes #29281. Vietnamese translations improvement [Form] Fixed FormErrorIterator class phpdoc Renamed test controller from Controller to TestController so it doesn't show up in the IDE autocomplete. Don't use he in docs when its not needed EventSubscriberInterface isn't a man fixed public directory of web server and assets install when configured in composer.json
2 parents f9718fc + ef06be5 commit 5af798a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Formatter/OutputFormatter.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function formatAndWrap(string $message, int $width)
166166
if (!$open && !$tag) {
167167
// </>
168168
$this->styleStack->pop();
169-
} elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
169+
} elseif (false === $style = $this->createStyleFromString($tag)) {
170170
$output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength);
171171
} elseif ($open) {
172172
$this->styleStack->push($style);
@@ -210,13 +210,14 @@ private function createStyleFromString(string $string)
210210
$style = new OutputFormatterStyle();
211211
foreach ($matches as $match) {
212212
array_shift($match);
213+
$match[0] = strtolower($match[0]);
213214

214215
if ('fg' == $match[0]) {
215-
$style->setForeground($match[1]);
216+
$style->setForeground(strtolower($match[1]));
216217
} elseif ('bg' == $match[0]) {
217-
$style->setBackground($match[1]);
218+
$style->setBackground(strtolower($match[1]));
218219
} elseif ('options' === $match[0]) {
219-
preg_match_all('([^,;]+)', $match[1], $options);
220+
preg_match_all('([^,;]+)', strtolower($match[1]), $options);
220221
$options = array_shift($options);
221222
foreach ($options as $option) {
222223
$style->setOption($option);

0 commit comments

Comments
 (0)