#40947 [Asn->Csd]: filter_var_aray() fails with a "common" filter
| From: | pajoye@php.net | Date: | Wed, 04 Apr 2007 20:51:52 +0000 |
| Subject: | #40947 [Asn->Csd]: filter_var_aray() fails with a "common" filter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111124@lists.php.net to get a copy of this message | ||
ID: 40947
Updated by: pajoye@php.net
Reported By: exaton at free dot fr
-Status: Assigned
+Status: Closed
Bug Type: Feature/Change Request
Operating System: WinXP SP2, Debian
PHP Version: 5.2.1
Assigned To: pajoye
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-03-29 14:29:07] pajoye@php.net
"Just commit this, it was supposed to work like this from the start."
No, it was not. I wrote this function in the fist place.
I will commit it later tonight.
------------------------------------------------------------------------
[2007-03-29 13:57:05] exaton at free dot fr
Thank you for taking the time to look at this, Pierre. My thanks to the
others as well.
As it happens, I believe I will follow your recommendation anyway and
use filter_var() for the purpose studied here, reserving
filter_var_array() for argument => definition fine-grained validation.
But I was intrigued by the "semi"-typo in the code.
So long all, keep up the excellent work !
David Holmes
------------------------------------------------------------------------
[2007-03-29 13:52:35] derick@php.net
Just commit this, it was supposed to work like this from the start.
------------------------------------------------------------------------
[2007-03-29 13:46:03] pajoye@php.net
"It's not that lines 818-819 don't accept an array -- it's that they
ONLY accept an array (because of the || instead of &&). But why test
whether, if the second param IS_LONG, it is an existing ID, then ?"
Ok, if you consider that passing only an integer is valid, then there
is a bug in this code (the expression is wrong). However it was never
thought or implemented to accept only a filter ID (to be applied to all
values). filter_var or filter_input has this feature.
I don't see a problem to accept this behavior (then we will have
multiple ways to achieve the same goal). Here is the patch against 5.2:
http://blog.thepimp.net/misc/filter_52_array_allow_id.txt
I'll wait Ilia's opinion on it (we discussed this exact thing a while
back), if he agrees, I'll apply the patch.
Changed to feature request.
------------------------------------------------------------------------
[2007-03-29 13:03:32] exaton at free dot fr
OK damn it, this typo is killing me as well. Responding to myself here
:
It's not that lines 818-819 don't accept an array -- it's that they
ONLY accept an array (because of the || instead of &&). But why test
whether, if the second param IS_LONG, it is an existing ID, then ?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/40947
--
Edit this bug report at http://bugs.php.net/?id=40947&edit=1