Skip to content

Commit

Permalink
Helpers: Fix routing to full domain
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Jan 5, 2020
1 parent 7e7ab64 commit 1c64f00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public static function processPath(): string
if (($currentUrl = self::getCurrentUrl()) !== null) {
if (preg_match('/^(?:https?:\/\/.+)\/www\/?(.*)$/', $currentUrl, $localUrlParser)) {
$return = $localUrlParser[1];
} elseif (preg_match('/^(?:https?:\/\/[^\/]+)(.*)$/', $currentUrl, $publicUrlParser)) {
$return = $publicUrlParser[2];
} elseif (preg_match('/^(?:https?:\/\/[^\/]+)(.*?)$/', $currentUrl, $publicUrlParser)) {
$return = $publicUrlParser[1];
}
}

return $return !== null ? rtrim($return, '/') : '';
return $return !== null ? trim($return, '/') : '';
}

/**
Expand Down

0 comments on commit 1c64f00

Please sign in to comment.