-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle exceptions when using /0 as a URL #2825
Conversation
Thanks Will. Since this is fixing a bug, it can target |
This is still an issue and has since carried over to the 5 branch of the CMS. |
eba3389
to
785676f
Compare
Rebased, added tests, and made changes necessary for those tests to pass. |
785676f
to
fb95dd3
Compare
fb95dd3
to
fbc5470
Compare
fbc5470
to
22e6dad
Compare
$link = trim(Director::makeRelative($link) ?? '', '/'); | ||
if (!$link) { | ||
if ($link === false || $link === null || $link === '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that while trim()
will only ever return a string, having the full check here avoids issues if we ever remove that trim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, works good
Fix for #2680