DataObjects/Core_curr_rate.php
[Pman.Core] / DataObjects / Core_email.php
index df87731..b91dda6 100644 (file)
@@ -188,9 +188,17 @@ class Pman_Core_DataObjects_Core_email extends DB_DataObject
         
         foreach ($xpath->query('//img[@src]') as $img) { // process images!
             $href = $img->getAttribute('src');
-            $cid = explode('#', $href);
-            if(isset($cid[1])){
-                $img->setAttribute('src', 'cid:' . $cid[1]);
+            $hash = explode('#', $href);
+            // we name all our cid's as attachment-*
+            // however the src url may be #image-*
+            
+            
+            if(!isset($hash[1])){
+                continue;
+            }
+            $cid = explode('-', $hash[1]);
+            if(!empty($cid[1])){
+                $img->setAttribute('src', 'cid:attachment-' . $cid[1]);
             }
         }