From a96133c5e2662c71f95428e30c58be0f8c9bfca1 Mon Sep 17 00:00:00 2001 From: stonebuzz Date: Thu, 11 Jan 2024 10:45:39 +0100 Subject: [PATCH] fix(Notification): fix conversion of relative URLs to aboslue URLs --- src/NotificationEventMailing.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NotificationEventMailing.php b/src/NotificationEventMailing.php index 36a6e10bb35e..a801255dadad 100644 --- a/src/NotificationEventMailing.php +++ b/src/NotificationEventMailing.php @@ -298,7 +298,7 @@ public static function send(array $data) $matches = []; if ( preg_match_all( - "/]*src=(\"|')[^\"']*document\.send\.php\?docid=([0-9]+)[^\"']*(\"|')[^<]*>/", + "/]*src=(\"|')[^\"']*document\.send\.php\?docid(?:=|=)([0-9]+)[^\"']*(\"|')[^<]*>/", $current->fields['body_html'], $matches ) @@ -375,8 +375,8 @@ public static function send(array $data) foreach ($inline_docs as $docID => $filename) { $current->fields['body_html'] = preg_replace( [ - '/src=["\'][^"\']*document\.send\.php\?docid=' . $docID . '(&[^"\']+)?["\']/', - '/href=["\'][^"\']*document\.send\.php\?docid=' . $docID . '(&[^"\']+)?["\']/', + '/src=["\'][^"\']*document\.send\.php\?docid(?:=|=)' . $docID . '(&[^"\']+)?["\']/', + '/href=["\'][^"\']*document\.send\.php\?docid(?:=|=)' . $docID . '(&[^"\']+)?["\']/', ], [ // 'cid' must be identical as second arg used in `embedFromPath` method