|
|
@@ -25,7 +25,7 @@ class UrlBuilder
|
|
|
{
|
|
|
$url = $base;
|
|
|
foreach ($tails as $tail) {
|
|
|
- $url = rtrim($url, '/').'/'.ltrim(strval($tail), '/');
|
|
|
+ $url = trim($url, '/').'/'.trim(strval($tail), '/');
|
|
|
}
|
|
|
|
|
|
return $url;
|
|
|
@@ -81,7 +81,7 @@ class UrlBuilder
|
|
|
* @param list<string> $parameters A list of parameters (can be an empty array)
|
|
|
* @param bool $preprendHttps Should the 'https://' be prepended if missing
|
|
|
*/
|
|
|
- public static function concat(string $url, array $tails, array $parameters, bool $preprendHttps = false): string
|
|
|
+ public static function concat(string $url, array $tails, array $parameters = [], bool $preprendHttps = false): string
|
|
|
{
|
|
|
$url = self::concatParameters(self::concatPath($url, $tails), $parameters);
|
|
|
if ($preprendHttps) {
|
|
|
@@ -104,6 +104,6 @@ class UrlBuilder
|
|
|
*/
|
|
|
public function getAbsoluteUrl(string $path): string
|
|
|
{
|
|
|
- return self::concat($this->baseUrl, [$path], []);
|
|
|
+ return self::concat($this->baseUrl, [$path]);
|
|
|
}
|
|
|
}
|