diff --git a/packages/Webkul/Email/src/Helpers/Htmlfilter.php b/packages/Webkul/Email/src/Helpers/Htmlfilter.php index 76404b722..73bd48afc 100644 --- a/packages/Webkul/Email/src/Helpers/Htmlfilter.php +++ b/packages/Webkul/Email/src/Helpers/Htmlfilter.php @@ -560,7 +560,12 @@ public function tln_fixatts( $trans_image_path, $block_external_images ) { - while ([$attname, $attvalue] = each($attary)) { + /** + * Convert to array if is not + */ + $attary = is_array($attary) ? $attary : []; + + foreach ($attary as $attname => $attvalue) { /** * See if this attribute should be removed. */ @@ -570,7 +575,7 @@ public function tln_fixatts( if (preg_match($matchattr, $attname)) { unset($attary[$attname]); - continue; + continue 2; } } }