From 47f6f1b4b89c655960ee02e73d3488c650254794 Mon Sep 17 00:00:00 2001 From: Philipp Batroff Date: Mon, 2 Jul 2018 11:50:44 +0200 Subject: [PATCH] Fix for #27: Correct link generation. Needs a bit more testing --- proxy/proxy.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/proxy/proxy.php b/proxy/proxy.php index 65382bd..6447010 100644 --- a/proxy/proxy.php +++ b/proxy/proxy.php @@ -96,7 +96,7 @@ function civiproxy_redirect($url_requested, $parameters) { * so they will point to this proxy instead */ function civiproxy_mend_URLs(&$string) { - global $target_rest, $target_url, $target_open, $target_file, $target_mail, $proxy_base, $target_mosaico; + global $target_rest, $target_url, $target_open, $target_file, $target_mail, $proxy_base, $target_mosaico, $target_civicrm; if ($target_rest) { $string = preg_replace("#{$target_rest}#", $proxy_base . '/rest.php', $string); @@ -115,8 +115,8 @@ function civiproxy_mend_URLs(&$string) { } if ($target_mosaico) { // replace full, and relative URL - $string = preg_replace("#{$target_mosaico}#", $proxy_base . '/mosaico.php?id=', $string); - $string = preg_replace("#/civicrm/mosaico/img\\?src=#", $proxy_base . '/mosaico.php?id=', $string); + // $string = preg_replace("#{$target_mosaico}#", $proxy_base . '/mosaico.php?id=', $string); + $string = preg_replace("#{$target_civicrm}/civicrm/mosaico/img\?src=#", $proxy_base . '/mosaico.php?id=', $string); } } @@ -335,4 +335,3 @@ function civiproxy_get_valid_allowed_actions_key($action, $rest_allowed_actions) } return $valid_key; } -