Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.8.8

Bug #15561 CSS URL image references lose a quote when sent
Submitted: 2009-01-08 10:09 UTC Modified: 2009-12-18 14:48 UTC
From: timj Assigned: alec
Status: Closed Package: Mail_Mime (version 1.5.2)
PHP Version: 5.2.8 OS:
Roadmaps: 1.5.3    
Subscription  


 [2009-01-08 10:09 UTC] timj (Tim Jackson)
Description: ------------ When including images using CSS, a quote is lost when Mail_Mime replaces the original filenames with cid: references. For example, if the original mail content contains: url("foo.jpg") this becomes: url("cid:.....) when Mail_Mime::get() is called (note missing trailing quote) Changing line 662 from this: $rep[] = 'url(\1cid:' . $value['cid'] . '\2)'; to this: $rep[] = 'url(\1cid:' . $value['cid'] . '\1)'; seems to fix it.

Comments

 [2009-01-15 09:41 UTC] doconnor (Daniel O'Connor)
Hey tim, want to whip up a quick executable test case for us? IE: require_once 'Foo.php'; $foo = new Foo(); assert($foo->encode("bar") == "rab"); // encode should spell it backwards
 [2009-04-25 19:00 UTC] timj (Tim Jackson)
Sorry for the slow reply. Here goes: ------------------------------------------------- require_once 'Mail/mime.php'; $MIME = new Mail_Mime(); $MIME->setHTMLBody('<style type="text/css">* { background-image: url("1.jpg"); }</style>'); $MIME->addHTMLImage('this-is-fake-data','image/jpeg','1.jpg',false); print $MIME->get(); -------------------------------------- output: ... <style type=3D"text/css">* { background-image: url("cid:149b1c2f106b8b0c311= 112c6b8e411ef); }</style>
 [2009-12-18 11:31 UTC] alec (Aleksander Machniak)
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: alec
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2009-12-18 14:48 UTC] alec (Aleksander Machniak)
-Roadmap Versions: +Roadmap Versions: 1.5.3