Skip to content

Commit

Permalink
Fixes passing null to escapeHtml() (#2884)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Jan 3, 2023
1 parent c74c1a6 commit 829daf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Helper/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function escapeHtml($data, $allowedTags = null)
}
} else {
// process single item
if (strlen($data)) {
if (is_string($data) && strlen($data)) {
if (is_array($allowedTags) && !empty($allowedTags)) {
$allowed = implode('|', $allowedTags);
$result = preg_replace('/<([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)>/si', '##$1$2$3##', $data);
Expand Down

0 comments on commit 829daf0

Please sign in to comment.