Skip to content

Commit

Permalink
Fix for systopia#38: added url encoding to mosaico template images, s…
Browse files Browse the repository at this point in the history
…o that google+.png works
  • Loading branch information
jaapjansma committed Nov 19, 2021
1 parent 6828950 commit 59b7544
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion de.systopia.civiproxy/CRM/Civiproxy/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ static function mendURLs(&$value) {
$value = preg_replace("#{$system_base}sites/default/files/civicrm/persist/#i", $proxy_base.'/file.php?id=', $value);
$value = preg_replace("#{$system_base}civicrm/mosaico/img\?src=#i", $proxy_base.'/mosaico.php?id=', $value);
if ($mosaico->isMosaicoInstalled()) {
$value = preg_replace("#({$mosaico->getMosaicoExtensionUrl()}/packages/mosaico/templates/)(\S*)([\"'])#i", $proxy_base . '/mosaico.php?template_url=$2$3', $value);
$value = preg_replace_callback("#({$mosaico->getMosaicoExtensionUrl()}/packages/mosaico/templates/)(\S*)([\"'])#i", function($matches) use ($proxy_base) {
return $proxy_base . '/mosaico.php?template_url=' . urlencode($matches[2]) . $matches[3];
}, $value);
}

// Mailing related functions
Expand Down

0 comments on commit 59b7544

Please sign in to comment.