mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fix BaseArrayHelper::htmlDecode() (#19386)
* Fix BaseArrayHelper::htmlDecode() Add missed second argument on recursive calling. * Fix BaseArrayHelper::htmlDecode() `htmlspecialchars_decode()` flags must be same to `htmlspecialchars()` in `BaseArrayHelper::htmlEncode()` * Update ArrayHelperTest.php * Update ArrayHelperTest.php * Update ArrayHelperTest.php * Update CHANGELOG.md * test workflow fix
This commit is contained in:
@ -1185,29 +1185,35 @@ class ArrayHelperTest extends TestCase
|
||||
3 => 'blank',
|
||||
[
|
||||
'<>' => 'a<>b',
|
||||
'<a>' => '<a href="index.php?a=1&b=2">link</a>',
|
||||
'23' => true,
|
||||
],
|
||||
];
|
||||
$this->assertEquals([
|
||||
|
||||
$expected = [
|
||||
'abc' => '123',
|
||||
'<' => '>',
|
||||
'cde' => false,
|
||||
3 => 'blank',
|
||||
[
|
||||
'<>' => 'a<>b',
|
||||
'<a>' => '<a href="index.php?a=1&b=2">link</a>',
|
||||
'23' => true,
|
||||
],
|
||||
], ArrayHelper::htmlDecode($array));
|
||||
$this->assertEquals([
|
||||
];
|
||||
$this->assertEquals($expected, ArrayHelper::htmlDecode($array));
|
||||
$expected = [
|
||||
'abc' => '123',
|
||||
'<' => '>',
|
||||
'cde' => false,
|
||||
3 => 'blank',
|
||||
[
|
||||
'<>' => 'a<>b',
|
||||
'<a>' => '<a href="index.php?a=1&b=2">link</a>',
|
||||
'23' => true,
|
||||
],
|
||||
], ArrayHelper::htmlDecode($array, false));
|
||||
];
|
||||
$this->assertEquals($expected, ArrayHelper::htmlDecode($array, false));
|
||||
}
|
||||
|
||||
public function testIsIn()
|
||||
|
Reference in New Issue
Block a user