Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef06be5

Browse files
Merge branch '3.4' into 4.1
* 3.4: [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 f939a68 + 769711e commit ef06be5

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
@@ -157,7 +157,7 @@ public function format($message)
157157
if (!$open && !$tag) {
158158
// </>
159159
$this->styleStack->pop();
160-
} elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
160+
} elseif (false === $style = $this->createStyleFromString($tag)) {
161161
$output .= $this->applyCurrentStyle($text);
162162
} elseif ($open) {
163163
$this->styleStack->push($style);
@@ -201,13 +201,14 @@ private function createStyleFromString(string $string)
201201
$style = new OutputFormatterStyle();
202202
foreach ($matches as $match) {
203203
array_shift($match);
204+
$match[0] = strtolower($match[0]);
204205

205206
if ('fg' == $match[0]) {
206-
$style->setForeground($match[1]);
207+
$style->setForeground(strtolower($match[1]));
207208
} elseif ('bg' == $match[0]) {
208-
$style->setBackground($match[1]);
209+
$style->setBackground(strtolower($match[1]));
209210
} elseif ('options' === $match[0]) {
210-
preg_match_all('([^,;]+)', $match[1], $options);
211+
preg_match_all('([^,;]+)', strtolower($match[1]), $options);
211212
$options = array_shift($options);
212213
foreach ($options as $option) {
213214
$style->setOption($option);

0 commit comments

Comments
 (0)