Skip to content

Commit

Permalink
fix(Notification): fix conversion of relative URLs to aboslue URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz authored and cedric-anne committed Jan 16, 2025
1 parent 83f72ad commit a96133c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/NotificationEventMailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public static function send(array $data)
$matches = [];
if (
preg_match_all(
"/<img[^>]*src=(\"|')[^\"']*document\.send\.php\?docid=([0-9]+)[^\"']*(\"|')[^<]*>/",
"/<img[^>]*src=(\"|')[^\"']*document\.send\.php\?docid(?:=|&#61;)([0-9]+)[^\"']*(\"|')[^<]*>/",
$current->fields['body_html'],
$matches
)
Expand Down Expand Up @@ -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(?:=|&#61;)' . $docID . '(&[^"\']+)?["\']/',
'/href=["\'][^"\']*document\.send\.php\?docid(?:=|&#61;)' . $docID . '(&[^"\']+)?["\']/',
],
[
// 'cid' must be identical as second arg used in `embedFromPath` method
Expand Down

0 comments on commit a96133c

Please sign in to comment.