From 20140a0d4138ca75af2f891dafb03d370fd4660a Mon Sep 17 00:00:00 2001 From: Philipp Batroff Date: Mon, 25 Nov 2019 17:48:32 +0100 Subject: [PATCH] [#38] Fix relative file paths for view in browser --- proxy/proxy.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy/proxy.php b/proxy/proxy.php index 3c41106..b031aee 100644 --- a/proxy/proxy.php +++ b/proxy/proxy.php @@ -112,6 +112,11 @@ function civiproxy_mend_URLs(&$string) { } if ($target_file) { $string = preg_replace("#{$target_file}#", $proxy_base . '/file.php?id=', $string); + // https://github.com/systopia/CiviProxy/issues/38 + // fix for relative + if ($target_mosaico) { + $string = preg_replace("#src=\"\/sites\/default\/files\/civicrm\/persist\/#", 'src="' . $proxy_base . '/file.php?id=', $string); + } } if ($target_mosaico) { // replace full, and relative URL