diff --git a/mimemail.inc b/mimemail.inc index 83c95aa..a81ffd2 100644 --- a/mimemail.inc +++ b/mimemail.inc @@ -438,8 +438,12 @@ function _mimemail_url($url, $embed_file = NULL) { global $base_url; $url = urldecode($url); + // If we're processing to embed the file, we're done here so return. + if ($embed_file) { + return $url; + } // If the URL is absolute or a mailto, return it as-is. - if (strpos($url, '://') !== FALSE || preg_match('!(mailto|callto|tel)\:!', $url)) { + elseif (strpos($url, '://') !== FALSE || preg_match('!(mailto|callto|tel)\:!', $url)) { $url = str_replace(' ', '%20', $url); return $url; } @@ -452,11 +456,6 @@ function _mimemail_url($url, $embed_file = NULL) { $url = preg_replace('!^' . base_path() . '!', '', $url, 1); - // If we're processing to embed the file, we're done here so return. - if ($embed_file) { - return $url; - } - if (!preg_match('!^\?q=*!', $url)) { $strip_clean = TRUE; }