Skip to content

Commit 744aaa9

Browse files
hctommarkhalliwell
hctom
authored andcommitted
Issue #2824661 by hctom: Passed value gets overridden in Bootstrap::glyphIconFromString() and Boootstrap::cssClassFromString()
1 parent aa3e13c commit 744aaa9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Bootstrap.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -379,16 +379,16 @@ public static function cssClassFromString(&$value, $default = '') {
379379

380380
// Iterate over the array.
381381
foreach ($texts as $pattern => $strings) {
382-
foreach ($strings as $value => $class) {
382+
foreach ($strings as $text => $class) {
383383
switch ($pattern) {
384384
case 'matches':
385-
if ($string === $value) {
385+
if ($string === $text) {
386386
return $class;
387387
}
388388
break;
389389

390390
case 'contains':
391-
if (strpos(Unicode::strtolower($string), Unicode::strtolower($value)) !== FALSE) {
391+
if (strpos(Unicode::strtolower($string), Unicode::strtolower($text)) !== FALSE) {
392392
return $class;
393393
}
394394
break;
@@ -680,16 +680,16 @@ public static function glyphiconFromString(&$value, $default = []) {
680680

681681
// Iterate over the array.
682682
foreach ($texts as $pattern => $strings) {
683-
foreach ($strings as $value => $icon) {
683+
foreach ($strings as $text => $icon) {
684684
switch ($pattern) {
685685
case 'matches':
686-
if ($string === $value) {
686+
if ($string === $text) {
687687
return self::glyphicon($icon, $default);
688688
}
689689
break;
690690

691691
case 'contains':
692-
if (strpos(Unicode::strtolower($string), Unicode::strtolower($value)) !== FALSE) {
692+
if (strpos(Unicode::strtolower($string), Unicode::strtolower($text)) !== FALSE) {
693693
return self::glyphicon($icon, $default);
694694
}
695695
break;

0 commit comments

Comments
 (0)