- fix regular expression for images src replacement

release-0.6
alecpl 15 years ago
parent e55923241f
commit c973abfd8b

@ -463,7 +463,7 @@ if (is_array($_SESSION['compose']['attachments']))
// This hook retrieves the attachment contents from the file storage backend // This hook retrieves the attachment contents from the file storage backend
$attachment = $RCMAIL->plugins->exec_hook('get_attachment', $attachment); $attachment = $RCMAIL->plugins->exec_hook('get_attachment', $attachment);
$dispurl = '/\ssrc\s*=\s*[\'"]*\S+display-attachment\S+file=rcmfile' . preg_quote($attachment['id']) . '[\s\'"]\s*/'; $dispurl = '/\ssrc\s*=\s*[\'"]*\S+display-attachment\S+file=rcmfile' . preg_quote($attachment['id']) . '[\s\'"]*/';
$message_body = $MAIL_MIME->getHTMLBody(); $message_body = $MAIL_MIME->getHTMLBody();
if ($isHtml && (preg_match($dispurl, $message_body) > 0)) { if ($isHtml && (preg_match($dispurl, $message_body) > 0)) {
$message_body = preg_replace($dispurl, ' src="'.$attachment['name'].'" ', $message_body); $message_body = preg_replace($dispurl, ' src="'.$attachment['name'].'" ', $message_body);

Loading…
Cancel
Save