|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
43 - 6 = ?
Subscribe to this entry?

 [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-2020 The PHP Group
All rights reserved.
Last updated: Thu May 28 06:01:25 2020 UTC