|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesmysqlnd_charset_fix_sjis.patch (last revision 2011-05-06 09:54 UTC by nihen at megabbs dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-06 12:11 UTC] nihen at megabbs dot com
[2011-05-09 17:50 UTC] uw@php.net
-Assigned To:
+Assigned To: mysql
[2011-05-09 18:20 UTC] andrey@php.net
[2011-05-09 18:24 UTC] andrey@php.net
-Status: Assigned
+Status: Closed
[2011-05-09 18:24 UTC] andrey@php.net
[2011-05-10 05:31 UTC] nihen at megabbs dot com
-Status: Closed
+Status: Assigned
[2011-05-10 05:31 UTC] nihen at megabbs dot com
[2011-05-10 09:15 UTC] andrey@php.net
-Status: Assigned
+Status: Closed
[2011-05-10 09:15 UTC] andrey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 23:00:01 2025 UTC |
Description: ------------ impacts to: 1. mysqli->real_escape_string 2. use PDO at PDO::ATTR_EMULATE_PREPARES = true "real_escape_string" must not escape multi-byte character. but escape it. This bug is a SQL-injection may cause. Test script: --------------- <?php $japanese_so = pack('H4', '835c'); $mysql = mysqli_connect('localhost', 'sandbox', 'sandbox'); $mysql->set_charset('sjis'); echo $mysql->real_escape_string($japanese_so) === $japanese_so ? 'ok' : 'ng'; echo "\n"; Expected result: ---------------- echo "ok\n" Actual result: -------------- echo "ng\n"