Usecase: To reduce HTML-Mails to a minimum size I use in the HTML head the following:

<head>
  <base href="http://www.example.com/path/to/my/image/directory/" />
  ...
</head>

so I can use relative URLs in img tags: <img src="example.jpg" />

_mimemail_file() replaces src="example.jpg" to src="Array" because:

mimemail_extract_files() calls _mimemail_file("example.jpg") in mimemail.inc Line 88

in _mimemail_file("example.jpg",...) happens the following:

if ($file && file_exists($file)) fails because file_exists($file) fails; Line 126

$files remains empty in line 148, because it is never touched since Line 110
so an empty array is returned.

Solution: simply return $url when you don't know what to do. The responsibility remains at the author to keep his URLs available.

Looking forward to see a fix in -dev.

regards.

Comments

jm.federico’s picture

Status: Active » Closed (duplicate)