-
Notifications
You must be signed in to change notification settings - Fork 38
Removed substr() and strlen() in favor of mb_* #22
Conversation
@weierophinney can you merge this? Thanks! |
Question: what happens when ext/mbstring is unavailable? Does the component throw an exception? |
@weierophinney no it doesn't :( We should add the ext/mbstring dependency on composer, without managing it in the code, what do you think? |
@ezimuel that would work. Add that, and then I think I can merge. I'll merge to develop for a forthcoming minor and/or major release, as it adds a requirement to the package. |
Removed substr() and strlen() in favor of mb_*
Merged to develop for release with either a 2.7.0 or 3.0.0 release. |
@weierophinney patch had no tests :-( |
@Ocramius adding a test here is like to test the PHP str functions for binary safe. See this issue ezimuel/phpcrypto#4. I don't think we need to provide one here. Thoughts? |
Disagreement here. Anybody patching code that isn't tested against
|
@Ocramius ok, but how we can prevent to re-introduce the problem here? We should test all the functions of our code with a multibyte string? |
Oof, yeah, I see your point, @Ocramius ; I was looking at it primarily as an internal refactor, and tests continued to pass, but the point is that multibyte strings should now also work, and if they don't it would be indicative of a regression. @ezimuel — this would mean adding either a new test case, or an element in a test provider, for each of the methods affected. Let's open an issue for that, and schedule it for a 2.7.1 release. |
@weierophinney I just opened the issue #23 /cc @Ocramius |
Thanks, @weierophinney @ezimuel I know I'm a pain in the ar_cough_, I am just worried about the actual issue though :-) |
This PR fixes the potential issue reported in #20.