diff --git a/src/helpers/UrlHelper.php b/src/helpers/UrlHelper.php index da8c9dcfd..5ab918480 100644 --- a/src/helpers/UrlHelper.php +++ b/src/helpers/UrlHelper.php @@ -71,8 +71,6 @@ public static function siteUrl(string $path = '', $params = null, string $scheme public static function mergeUrlWithPath(string $url, string $path): string { $overlap = 0; - $url = rtrim($url, '/'); - $path = ltrim($path, '/'); $urlOffset = strlen($url); $pathLength = strlen($path); $pathOffset = 0; @@ -84,7 +82,7 @@ public static function mergeUrlWithPath(string $url, string $path): string } } - return $url . '/' . ltrim(substr($path, $overlap), '/'); + return rtrim($url, '/') . '/' . ltrim(substr($path, $overlap), '/'); } /**