php5 UTF-8 bug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PHP-FPM |
New
|
Undecided
|
Unassigned | ||
php5 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Linux servername 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Bug found, when using pho5-fpm:
Package: php5-fpm
Status: install ok installed
Priority: optional
Section: php
Installed-Size: 8081
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Source: php5
Version: 5.3.10-1ubuntu3.4
Provides: phpapi-20090626
Depends: libbz2-1.0, libc6 (>= 2.15), libdb5.1, libpcre3 (>= 8.10), libssl1.0.0 (>= 1.0.0), libxml2 (>= 2.7.4), zlib1g (>= 1:1.1.4), mime-support, php5-common (= 5.3.10-1ubuntu3.4), libmagic1, ucf, tzdata
Pre-Depends: dpkg (>= 1.15.7.2~)
Suggests: php-pear
Php application receives registration form with two fields (Name, Surname) in ru_RU UTF-8. I've checked content of $_REQUEST and $_POST, and there array 'client', which contains fields with normal valid UTF-8 strings. But then developer of application getting 'client' array to separate array variable:
$c = $_POST['client'];
and $c then contains invalid UTF-8 sequences.
for example in source was d180d0b8
but in $c it becomes f180d0b8
as you can see, it's invalid sequence and invalid behaviour of php.
and then database engine gives error about that.
I solved issue by getting values directly:
$data = array(
)
and it works. But the bug still remains and may cause lots of problems.
Thank you for taking the time to report this bug and helping to make Ubuntu better.
Please could you post a test case, complete with detailed step-by-step instructions to reproduce this problem, expected results and actual results? Ideally this would use php from the command line, but if that can't reproduce the problem then a php script to run through the web server would be fine.
Once done, please change the bug status back to New.