Skip to content

Commit 6dd25f4

Browse files
authored
[7.x] allow to reset forced scheme and root-url (#34039)
* allow to reset forced scheme and root-url * fix StyleCI
1 parent 6891cb5 commit 6dd25f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Illuminate/Routing/UrlGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,25 +616,25 @@ public function getDefaultParameters()
616616
/**
617617
* Force the scheme for URLs.
618618
*
619-
* @param string $scheme
619+
* @param string|null $scheme
620620
* @return void
621621
*/
622622
public function forceScheme($scheme)
623623
{
624624
$this->cachedScheme = null;
625625

626-
$this->forceScheme = $scheme.'://';
626+
$this->forceScheme = $scheme ? $scheme.'://' : null;
627627
}
628628

629629
/**
630630
* Set the forced root URL.
631631
*
632-
* @param string $root
632+
* @param string|null $root
633633
* @return void
634634
*/
635635
public function forceRootUrl($root)
636636
{
637-
$this->forcedRoot = rtrim($root, '/');
637+
$this->forcedRoot = $root ? rtrim($root, '/') : null;
638638

639639
$this->cachedRoot = null;
640640
}

0 commit comments

Comments
 (0)