-
Notifications
You must be signed in to change notification settings - Fork 8k
standard: Validate sort_type argument in array_unique() #21110
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
base: master
Are you sure you want to change the base?
Conversation
iluuu1994
left a comment
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.
It looks like this is also missing handling for SORT_FLAG_CASE, which looks to be untested. https://3v4l.org/dqSln This is just from a very quick look, there might be other issues.
iluuu1994
left a comment
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.
Marking as "Request changes" for visibility.
Co-authored-by: Ilija Tovilo <[email protected]>
Co-authored-by: Ilija Tovilo <[email protected]>
I don’t see |
…into array_unique
|
It's not documented, but it's there, as demonstrated by the 3v4l. |
iluuu1994
left a comment
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.
That's all the issues I could find. Please somebody else verify. I'm not code owner.
| if (base_sort != PHP_SORT_REGULAR | ||
| && base_sort != PHP_SORT_NUMERIC | ||
| && base_sort != PHP_SORT_STRING | ||
| && base_sort != PHP_SORT_LOCALE_STRING) { |
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.
There's also SORT_NATURAL. I don't know whether it would differ in behavior from SORT_STRING, but even if it doesn't it should continue to be accepted.
The
array_unique()now validates thesort_typeargument and throwsValueErrorwhen an unsupported value is provided.