Skip to content

Commit

Permalink
Issue #111: Allow urls starting with '//'. These will be treated as e…
Browse files Browse the repository at this point in the history
…xternal URLs
  • Loading branch information
igaster committed Jul 3, 2019
1 parent 0b8be5d commit f75d323
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ public function getViewPaths()

public function url($url)
{
$url = ltrim($url, '/');
// return external URLs unmodified
if (preg_match('/^((http(s?):)?\/\/)/i', $url)) {
return $url;
}

$url = ltrim($url, '/');

// Is theme folder located on the web (ie AWS)? Dont lookup parent themes...
if (preg_match('/^((http(s?):)?\/\/)/i', $this->assetPath)) {
return $this->assetPath . '/' . $url;
Expand Down

0 comments on commit f75d323

Please sign in to comment.