php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29908 explode() corrupts utf8 data
Submitted: 2004-08-31 10:53 UTC Modified: 2005-03-20 18:04 UTC
Votes:6
Avg. Score:4.0 ± 1.2
Reproduced:5 of 6 (83.3%)
Same Version:1 (20.0%)
Same OS:2 (40.0%)
From: sven dot burmeister at gmx dot net Assigned:
Status: No Feedback Package: Strings related
PHP Version: 5.0.1 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sven dot burmeister at gmx dot net
New email:
PHP Version: OS:

 

 [2004-08-31 10:53 UTC] sven dot burmeister at gmx dot net
Description:
------------
utf8 encoded page, send <input type=text name=foo, if you input ferienh?user and use array = explode(" ",$_REQUEST["foo"]) on that variable you get an array with echo $array[0] displayed in the browser source as ferienh??user instead of ferienhÀuser.

echo $_REQUEST["foo"]; displays correctly

Same happens if string submitted is "ferienh?user region" so it is not due to the lack of a space in the string.

using php5 compiled with latest apache and mysql-support on suse linux 9.0.

Reproduce code:
---------------
<input type=text name=foo value=''>
if($_REQUEST["foo"] != ""){$array = explode(" ",$foo)}

Expected result:
----------------
in_array("ferienh?user",$array) == true;

Actual result:
--------------
As described above in_array does not find the keyword and all browsers do not display $array[0] correctly, although they do for $_REQUEST["foo"]

Reason, string gets corrupted.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-07 20:56 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-20 18:04 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC