When i send mail (via simplenews) that contains images with spaces, they are not included.
nothing is changed in the html so the reciever gets a broken image if the image uri is not absolute.

example:

<img src="/files/images/name%20withspaces.png" />

Comments

geek-merlin’s picture

Notice: %xx entities wont get decoded, so no wonder the file ist not found.

In mimemail.inc change

function mimemail_extract_files($html) {
  $pattern = '/(<link[^>]+href="?|<object[^>]+codebase="?|@import |src="?)\/?([^"]+)("?)/emis';
  $html = preg_replace($pattern,'"\\1". _mimemail_file("\\2") ."\\3"', $html);

to

function mimemail_extract_files($html) {
  $pattern = '/(<link[^>]+href="?|<object[^>]+codebase="?|@import |src="?)\/?([^"]+)("?)/emis';
  $html = preg_replace($pattern,'"\\1". _mimemail_file(urldecode("\\2")) ."\\3"', $html);

(notice "urldecode" inserted)

I will do some testing and report more.

allie micka’s picture

Status: Active » Closed (duplicate)

Marking as a dupe of http://drupal.org/node/43613 . Please follow along there!