Skip to content

Commit

Permalink
Switch to Str helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Persaeus authored and taylorotwell committed Apr 23, 2020
1 parent 87485bd commit 0099591
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Http/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function withFragmentIdentifier(string $fragmentIdentifier)
$this->withoutFragmentIdentifier();

// Strip superfluous "#" from the beginning of the fragment identifier
$fragmentIdentifier = preg_replace('/^#/', '', $fragmentIdentifier);
$fragmentIdentifier = Str::after($fragmentIdentifier, '#');

return $this->setTargetUrl($this->getTargetUrl()."#$fragmentIdentifier");
}
Expand All @@ -169,7 +169,7 @@ public function withFragmentIdentifier(string $fragmentIdentifier)
*/
public function withoutFragmentIdentifier()
{
return $this->setTargetUrl(explode('#', $this->getTargetUrl(), 2)[0]);
return $this->setTargetUrl(Str::before($this->getTargetUrl(), '#'));
}

/**
Expand Down

0 comments on commit 0099591

Please sign in to comment.