Fix: include external image link is impossible

This commit is contained in:
Regis Houssin 2009-11-18 14:19:03 +00:00
parent edb179064b
commit 37d1e86733

View File

@ -975,7 +975,8 @@ class CMailFile
$i=0; $i=0;
foreach ($matches[1] as $full) foreach ($matches[1] as $full)
{ {
preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i',$full,$regs); if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i',$full,$regs))
{
$img = $regs[1]; $img = $regs[1];
if (file_exists($images_dir.'/'.$img)) if (file_exists($images_dir.'/'.$img))
@ -995,11 +996,11 @@ class CMailFile
// cid // cid
$this->html_images[$i]["cid"] = md5(uniqid(time())); $this->html_images[$i]["cid"] = md5(uniqid(time()));
$this->html = preg_replace("/src=\"$src\"|src='$src'/i", "src=\"cid:".$this->html_images[$i]["cid"]."\"", $this->html); $this->html = preg_replace("/src=\"$src\"|src='$src'/i", "src=\"cid:".$this->html_images[$i]["cid"]."\"", $this->html);
} }
$i++; $i++;
} }
}
if (!empty($this->html_images)) if (!empty($this->html_images))
{ {