Skip to content
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

php54 polyfill hex2bin(): don't return false if nul bytes found #48

Merged
merged 2 commits into from
Mar 29, 2016

Conversation

fuhry
Copy link
Contributor

@fuhry fuhry commented Mar 25, 2016

Fixes #47

@xabbuh
Copy link
Member

xabbuh commented Mar 25, 2016

If this is the expected behaviour, we will at least need a test to prevent regressions.

@fuhry
Copy link
Contributor Author

fuhry commented Mar 25, 2016

@xabbuh Test added.

@binwiederhier
Copy link

I suspect that this is a rather big issue on older systems using Symfony. The current implementation apparently does not correctly convert hex strings with null bytes. I'd really love to see this in the next release. Thanks!

@@ -33,10 +33,6 @@ public static function hex2bin($data)

$data = pack('H*', $data);
Copy link
Member

Choose a reason for hiding this comment

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

No need for the $data intermediate step. Can you return directly please?

@binwiederhier
Copy link

@fuhry In the interest of time, I took the liberty of making the requested changes in #49 -- I hope that's alright.

@nicolas-grekas Looks alright now? See #49

@nicolas-grekas nicolas-grekas merged commit e66be8c into symfony:master Mar 29, 2016
nicolas-grekas added a commit that referenced this pull request Mar 29, 2016
This PR was merged into the 1.1-dev branch.

Discussion
----------

Fix hex2bin return null

Fixes the hex2bin implementation as per #47/#48.
This supersedes #48.

Commits
-------

7d2358d Removed reference to issue/pull
d48b373 Code review changes, fix tests
e66be8c polyfill php54: add test for nul byte handling
ddfa268 php54 polyfill hex2bin(): don't return false if nul bytes found
@nicolas-grekas
Copy link
Member

Thank you @fuhry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants