Bug #79237 [Opn->Fbk]: filter_var limited to 8192 characters in input string

From: Date: Fri, 07 Feb 2020 08:03:54 +0000
Subject: Bug #79237 [Opn->Fbk]: filter_var limited to 8192 characters in input string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225415@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
 Updated by:         cmb@php.net
 Reported by:        murray at focus-computing dot com dot au
 Summary:            filter_var limited to 8192 characters in input
                     string
-Status:             Open
+Status:             Feedback
 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:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

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>


Previous Comments:
------------------------------------------------------------------------
[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


Thread (4 messages)

« previous php.bugs (#225415) next »