Skip to content

Commit

Permalink
Merge pull request #15 from iMi-digital/feature/external-urls
Browse files Browse the repository at this point in the history
Add support for external urls
  • Loading branch information
amenk authored Oct 17, 2019
2 parents 99d513a + 1fc53f2 commit c2234ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit c2234ba

Please sign in to comment.