Bug #79237 [Fbk->Asn]: filter_var limited to 8192 characters in input string
| From: | murray at focus-computing dot com dot au | Date: | Fri, 07 Feb 2020 09:41:57 +0000 |
| Subject: | Bug #79237 [Fbk->Asn]: filter_var limited to 8192 characters in input string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225420@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79237&edit=1
ID: 79237
User updated by: murray at focus-computing dot com dot au
Reported by: murray at focus-computing dot com dot au
Summary: filter_var limited to 8192 characters in input
string
-Status: Feedback
+Status: Assigned
Type: Bug
Package: *Regular Expressions
Operating System: Debian 4.19.67-2+deb10u1 (2019-0
PHP Version: 7.3Git-2020-02-07 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I tried pcre.jit=0 and this worked.
I'm not sure what that changes, or why it worked. I'm happy, but perhaps we should add a
comment to the online manual?
Previous Comments:
------------------------------------------------------------------------
[2020-02-07 08:03:54] cmb@php.net
Please try again with pcre.jit=0 (unless you did already). With
pcre.jit=1, I get PCRE2_ERROR_JIT_STACKLIMIT[1] internally.
[1] <https://www.pcre.org/current/doc/html/pcre2api.html#SEC31>
------------------------------------------------------------------------
[2020-02-07 03:29:54] murray at focus-computing dot com dot au
Description:
------------
I was testing some input being passed via a parameter to my script. I was getting an error
indicating that the value passed was invalid, yet it didn't contain any of the strings I was
searching for.
I went through the process of shortening the string and when I got below 8192 chars in length it
worked, over 8192 chars in length it would fail.
I also tried this on PHP v7.1.32 and the exact same code on my Mac OSX which worked correctly.
Test script:
---------------
filter_var(trim($_REQUEST['parms']), FILTER_VALIDATE_REGEXP, array("options"
=> array("regexp" => "/^((?!union select|union all|\'A=|select
char).)*$/im")));
Expected result:
----------------
A) filter_var should handle strings longer than 8192 chars
OR
B) Add documentation to filter_var manual entry indicating maximum length of string.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79237&edit=1