Skip to content

Commit caf030a

Browse files
authored
Merge pull request #4478 from csears123/patch-2
PHP 8.1 support for active checkbox list
2 parents 89ff97c + 13b5f79 commit caf030a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Version 1.1.26 under development
55
--------------------------------
66

7-
- Enh #4386: Added support for PHP 8.1 (marcovtwout, JonathanArgentao, ivany4)
7+
- Enh #4386: Added support for PHP 8.1 (marcovtwout, JonathanArgentao, ivany4, csears123)
88
- Enh #4386: Updated HTMLPurifier to version 4.14.0-master-1dd3e52 for PHP 8.1 support (https://github.com/ezyang/htmlpurifier/blob/v4.14.0/NEWS) (marcovtwout)
99
- Enh #4392: Added support for SSL to CRedisCache (andres101)
1010
- Bug #4453: Alpine Linux compatibility: Avoid using `GLOB_BRACE` in `CFileHelper::removeDirectory` (ivany4)

framework/web/helpers/CHtml.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ public static function checkBoxList($name,$select,$data,$htmlOptions=array())
11681168

11691169
foreach($data as $value=>$labelTitle)
11701170
{
1171-
$checked=!is_array($select) && !strcmp($value,$select) || is_array($select) && in_array($value,$select);
1171+
$checked=!is_array($select) && !strcmp($value,(string)$select) || is_array($select) && in_array($value,$select);
11721172
$checkAll=$checkAll && $checked;
11731173
$htmlOptions['value']=$value;
11741174
$htmlOptions['id']=$baseID.'_'.$id++;
@@ -1280,7 +1280,7 @@ public static function radioButtonList($name,$select,$data,$htmlOptions=array())
12801280
$id=0;
12811281
foreach($data as $value=>$labelTitle)
12821282
{
1283-
$checked=!strcmp($value,$select);
1283+
$checked=!strcmp($value,(string)$select);
12841284
$htmlOptions['value']=$value;
12851285
$htmlOptions['id']=$baseID.'_'.$id++;
12861286
$option=self::radioButton($name,$checked,$htmlOptions);

0 commit comments

Comments
 (0)