From 1fc53f206eaaa7a055470b20d1c3b7fd945e36b6 Mon Sep 17 00:00:00 2001 From: klg Date: Thu, 17 Oct 2019 12:08:15 +0200 Subject: [PATCH] Add support for external urls --- Helper/Data.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Helper/Data.php b/Helper/Data.php index 6f15185..2dd4aeb 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -24,12 +24,19 @@ public function __construct( * Build final URL from redirect entry * * @param $redirectUrl + * + * @return string */ public function buildUrl($redirectUrl) { if ($redirectUrl == '/') { $redirectUrl = ''; } + + if(preg_match('/^https?/', $redirectUrl)) { + return $redirectUrl; + } + return $this->_urlBuilder->getUrl('', array('_direct' => $redirectUrl)); }