|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #56810 input_get octal and hexa
Submitted: 2006-01-31 10:08 UTC Modified: 2006-01-31 14:13 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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: x dot philbert at pixandlog dot com
New email:
PHP Version: OS:


 [2006-01-31 10:08 UTC] x dot philbert at pixandlog dot com
i don't understand filter on octal and hexa. Why input_get return one error on '-01' or '-0xF' in $_GET|POST ?

decimal     : [1-9][0-9]*
            | 0

hexadecimal : 0[xX][0-9a-fA-F]+

octal       : 0[0-7]+

integer     : [+-]?decimal
            | [+-]?hexadecimal
            | [+-]?octal

With octal value, it's not possible to send '00', why ?

/* state 0 */
if (*p == '-' || *p == '+') {
  ctx_multiply = *p == '-' ? -1 : 1; p++; goto stateI1; <<<=== Why not continue to Octal or Hexa goto ?
} else {
  goto stateOH1;

Thank you for your work.

Expected result:
I expect negatives values for negatives input.
I expect a value equal at 0 for octal value 00.

Actual result:
$source = INPUT_GET;
$name = 'foo';

$ret = input_get($source, $name, array('flags' => Filter::FILTER_FLAG_ALLOW_OCTAL));

echo '$ret = '; echo $ret;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-31 14:13 UTC]
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

In case this was a 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.

This was not supposed to work, and therefore I reclassified it as Feature Request. I committed a change to CVS that implemented this FR.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 21:01:31 2024 UTC