From: Edward Date: Tue, 24 Jul 2018 05:13:08 +0000 (+0800) Subject: Mailer.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=fd17a6eeb2c5bbe5ec7575da642a0aee021faac4 Mailer.php --- diff --git a/Mailer.php b/Mailer.php index 334baa3e..24a9a70e 100644 --- a/Mailer.php +++ b/Mailer.php @@ -386,7 +386,7 @@ class Pman_Core_Mailer { @$dom->loadHTML('' .$html); $imgs= $dom->getElementsByTagName('img'); - $test = array(); + $urls = array(); foreach ($imgs as $i=>$img) { $url = $img->getAttribute('src'); @@ -397,7 +397,15 @@ class Pman_Core_Mailer { if ($me == 'no') { continue; } - $test[] = $url; + + if(!array_key_exists($url, $urls)){ + $conv = $this->fetchImage($url); + $this->images[$conv['contentid']] = $conv; + } else { + $conv = $urls[$url]; + } + + } print_R($test);exit;