The function css_style_to_array in mimemail_compress.inc assumes there will be no colons in the attribute value, but there can be such in the case of a background-image attribute, for example: background-image:url('http://mysite.com/images/bg_750.gif');

As a result the module currently mangles that attribute.

The code that does this:

        list($key,$value) = explode(':',$def);

Could be replaced with:

        preg_match("/([^:]+):(.+)/", $def, $matches);
        $key   = $matches[1];
        $value = $matches[2];

Or am I wrong?

Thanks,
Ralph Dosser

CommentFileSizeAuthor
#3 mimemail.517306_02.patch947 bytessgabe
#2 mimemail.517306_01.patch996 bytessgabe

Comments

tobiberlin’s picture

As I think this post relates on what I am facing currently I want to add my subscription to this issue: When I send an email with css-definitions which include background-images with an absolute URL the URL is cut after "http" in the email....

sgabe’s picture

Title: css_style_to_array mangles full URLs » Mime Mail Compress mangles absolute URLs in CSS properties
Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new996 bytes

I can confirm this issue. The pattern looks good, but I would leave the list construct, it is much elegant. :-)

sgabe’s picture

StatusFileSize
new947 bytes

Please, ignore the previous patch.

sgabe’s picture

Status: Needs review » Fixed

Committed to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.