php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65155 hex2bin() should behave consistent
Submitted: 2013-06-28 01:50 UTC Modified: 2013-07-08 10:40 UTC
From: yohgaki at ohgaki dot net Assigned: yohgaki (profile)
Status: Closed Package: *General Issues
PHP Version: 5.4Git-2013-06-28 (Git) OS: any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yohgaki at ohgaki dot net
New email:
PHP Version: OS:

 

 [2013-06-28 01:50 UTC] yohgaki at ohgaki dot net
Description:
------------
hex2bin() returns false for invalid inputs. However, it raise E_WARNING and 
return FALSE for invalid length, but it simply returns FALSE for bad chars.

Solution:
Add E_WARING or remove them.

Since hex2bin() is not supposed to handle external input for most cases, Adding 
E_WARNING would be nicer than removing.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-28 01:50 UTC] yohgaki@php.net
-Assigned To: +Assigned To: yohgaki
 [2013-06-28 01:50 UTC] yohgaki@php.net
-Status: Assigned +Status: Open
 [2013-07-08 10:40 UTC] yohgaki@php.net
-Status: Assigned +Status: Closed
 [2013-07-08 10:40 UTC] yohgaki@php.net
Change is committed. 5.5>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 03:01:31 2025 UTC