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

Skip to content

Commit 01be377

Browse files
authored
fix: undefined array key warning (#419)
1 parent f0fbf51 commit 01be377

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

library/HTMLPurifier/EntityParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ public function substituteAttrEntities($string)
116116
protected function entityCallback($matches)
117117
{
118118
$entity = $matches[0];
119-
$hex_part = @$matches[1];
120-
$dec_part = @$matches[2];
119+
$hex_part = isset($matches[1]) ? $matches[1] : null;
120+
$dec_part = isset($matches[2]) ? $matches[2] : null;
121121
$named_part = empty($matches[3]) ? (empty($matches[4]) ? "" : $matches[4]) : $matches[3];
122122
if ($hex_part !== NULL && $hex_part !== "") {
123123
return HTMLPurifier_Encoder::unichr(hexdec($hex_part));

0 commit comments

Comments
 (0)