php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56809 input_get hexa not support string upper
Submitted: 2006-01-31 09:20 UTC Modified: 2006-01-31 13:51 UTC
From: x dot philbert at pixandlog dot com Assigned: derick (profile)
Status: Closed Package: filter (PECL)
PHP Version: 5.1.1 OS: linux gentoo
Private report: No CVE-ID: None
 [2006-01-31 09:20 UTC] x dot philbert at pixandlog dot com
Description:
------------
Filter-0.9.4

stateOH1: /* state "octal or hex" */
	if (*p != '0') {
		goto stateI1;
	}
	p++;
	if (*p == 'x') {   <===HERE: not test 'X'
		if (allow_hex) {
			p++;
			goto stateH1;
		} else {
			goto stateE;
		}


stateH1: /* state "hex 1" */
	ctx_type = TYPE_HEX;
	if ((*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f')) { <<<===HERE: not test 'A' - 'F'
		ctx_value *= 16;
		if (*p >= '0' && *p <= '9') {
			ctx_value += ((*p) - '0');
		}
		if (*p >= 'a' && *p <= 'f') {
			ctx_value += 10 + ((*p) - 'a');
		}
		p++;
		goto stateH1;
	}


Reproduce code:
---------------
$source = INPUT_GET;
$name = $_GET['foo'];
$option = array('flags' => FILTER_FLAG_ALLOW_HEX);

$ret = input_get($source, $name, parent::FILTER_VALIDATE_INT, $options);

in $_GET['foo'] == 0XF; or 0xF or 0Xf;



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-31 13:51 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 14:01:30 2024 UTC