Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rastographics
Copy link

There's a weird bug.

For some reason, PHP evaluates this statement to be true:
"*example" < 0

It only happens when an asterisk is at the beginning of the string.

For comparison, this statement is false:
"example" < 0

Because of this, the urlSegment() function proceeds to run the next line in the IF statement, which throws an error when abs() chokes on the given string.

This change would check to make sure the given input is in fact an integer before proceeding to run the code that assumes it was given an integer.

This would allow use of wildcards that start with an asterisk. Currently using $input->urlSegment("*example") throws error.

There's a weird bug.

For some reason, PHP evaluates this statement to be true:
"*example" < 0

It only happens when an asterisk is at the beginning of the string.

For comparison, this statement is false:
"example" < 0

Because of this, the urlSegment() function proceeds to run the next line in the IF statement, which throws an error when abs() chokes on the given string.


This change would check to make sure the given input is in fact an integer before proceeding to run the code that assumes it was given an integer.

This would allow use of wildcards that start with an asterisk. Currently using $input->urlSegment("*example") throws error.
@poljpocket
Copy link
Contributor

Good catch! This must be something which changed in PHP8+:

https://3v4l.org/Y4l6j#veol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants