Fixes h() to not return empty string when input string contains invalid code unit sequence.#1080
Fixes h() to not return empty string when input string contains invalid code unit sequence.#1080uzyn wants to merge 2 commits intocakephp:masterfrom uzyn:bugfix/debug
Conversation
…an invalid code unit sequence.
|
I think I ran into the same thing a few times, as well. Wondering why the non-empty string was "supposedly" empty in debug output. |
|
|
lib/Cake/Test/Case/BasicsTest.php
Outdated
There was a problem hiding this comment.
Better to use the cake.power.gif image from Test/test_app/. Also as per cake's coding standard there should be a space before and after each .. You can use https://github.com/cakephp/cakephp-codesniffer
There was a problem hiding this comment.
Thanks. Coincidentally, I have also just submitted a better test case without having to rely on binary file.
|
@majna You're right. I did not realize that. Even I guess we'll have to run a regex and replace the invalid chars manually. |
|
You can target your PR for 3.0, though :) |
|
Closing as this requires features that don't exist in 5.2. |
|
If you don't mind the extra work a PR for 3.0 would be greatly appreciated :D |
Caught me by surprise when I passed an object containing some invalid code unit sequence (binary data) to
debug()but it returned me an empty string, even though there are plaintext properties (which I was interested in).Even for normal usage, I think
h()should not return a result that's far too different from the original input, especially when there are other valid plantext characters.