#48163 [Fbk]: FILTER_CALLBACK generates strange results
| From: | fa@php.net | Date: | Wed, 06 May 2009 13:42:48 +0000 |
| Subject: | #48163 [Fbk]: FILTER_CALLBACK generates strange results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136837@lists.php.net to get a copy of this message | ||
ID: 48163
Updated by: fa@php.net
Reported By: redaction at nuxwin dot com
Status: Feedback
Bug Type: Filter related
Operating System: debian
PHP Version: 5.2.9
New Comment:
works fine for me with 5.2.9 release and CLI
Previous Comments:
------------------------------------------------------------------------
[2009-05-06 13:40:06] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Works fine for me..
------------------------------------------------------------------------
[2009-05-06 11:50:29] redaction at nuxwin dot com
excuse, :
Actual result:
<pre>Array
(
[0] =>
���)������
)
</pre>
------------------------------------------------------------------------
[2009-05-06 11:48:36] redaction at nuxwin dot com
Description:
------------
HI all,
When I apply a one trim callback via filter, I get an erroneous result
on the display.
Sorry , i'm french...
Reproduce code:
---------------
$_SERVER['REMOTE_ADDR'] = ' 80.10.20.30 ';
$remote_addr_list = explode(',', $_SERVER['REMOTE_ADDR']);
filter_var_array(array('remote_addr_list' => $remote_addr_list),
array('remote_addr_list' => array('filter' => FILTER_CALLBACK,
'options' => 'trim','flags'=>
FILTER_REQUIRE_ARRAY|FILTER_FORCE_ARRAY)));
I has this result :
echo '<pre>';
print_r($remote_addr_list);
echo '</pre>';
Expected result:
----------------
Array
(
[0] => 80.10.20.30
)
Actual result:
--------------
Array
(
[0] =>
���)������
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48163&edit=1