-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 illegal string offset #19370
Fix illegal string offset #19370
Conversation
In legacy calls it is common to have the second arg as a string. So, if the second arg is not array, it should be proccessed as legacy.
See #15641. The final decision was to fix the faulty code that called this method. |
@Quy, what final decision? The PR in your example was closed. |
To fix the faulty calling code and not the method. Read this comment. |
@Quy, can you cite it here, please? I have no idea how this related to what I propose. |
I fixed the link. Here is the comment:
|
@Quy, what about b/c and coding standards "the code without warnings and notices"? |
This PR is masking the issue where the warning origins because apparently there is code somewhere which calls this method wrong. Read the discussion in #15641. |
@Quy, this PR is completelly different. It is soft check what type of arguments is passed. If any of arguments has wrong type, it is processed as legacy. In your example it is forced it to be a certain type. |
At least with the For the It is not our role as the API providers to cater to developers who are doing it wrong. Based on our documentation, that is what we should be coding for and any other condition is invalid use of the API. |
closed for the reasons stated above by @mbabker |
In legacy calls it is common to have the args as a string. So, if the first/second arg is not array, it should be proccessed as legacy.