Skip to content

Commit 0099591

Browse files
Persaeustaylorotwell
authored andcommitted
Switch to Str helper functions
1 parent 87485bd commit 0099591

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Http/RedirectResponse.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function withFragmentIdentifier(string $fragmentIdentifier)
157157
$this->withoutFragmentIdentifier();
158158

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

162162
return $this->setTargetUrl($this->getTargetUrl()."#$fragmentIdentifier");
163163
}
@@ -169,7 +169,7 @@ public function withFragmentIdentifier(string $fragmentIdentifier)
169169
*/
170170
public function withoutFragmentIdentifier()
171171
{
172-
return $this->setTargetUrl(explode('#', $this->getTargetUrl(), 2)[0]);
172+
return $this->setTargetUrl(Str::before($this->getTargetUrl(), '#'));
173173
}
174174

175175
/**

0 commit comments

Comments
 (0)