Skip to content

Conversation

@ndossche
Copy link
Member

No description provided.

@devnexen
Copy link
Member

looks to me strcoll is purposely not binary safe, at least is self-aware of it according to the docs. Kind of BC changes ?

ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_STR(s1)
Z_PARAM_STR(s2)
Z_PARAM_PATH_STR(s1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably need 2 test cases at least.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said in private, I wonder if it isn't better to deprecate locale aware string compares in general. As this also affects the sort functions using SORT_LOCALE_STRING as it calls string_locale_compare_function() which also truncates at the first nul byte.

And while this is dumb, it is documented on the manual and has been for ages. And there are some other functions that are documented to not be binary safe (crypt(), SQLite3::escapeString(), and error_log() from a quick source search of the note and text). So if we do it for this function I'd wager we should do it for the other ones that we control.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants