#49814 [Com]: htmlentities/htmlspecialchars accept partial multibyte sequences still

From: Date: Fri, 09 Oct 2009 11:50:13 +0000
Subject: #49814 [Com]: htmlentities/htmlspecialchars accept partial multibyte sequences still
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143412@lists.php.net to get a copy of this message
ID: 49814 Comment by: mcdmaster at auone dot jp Reported By: hello at iwamot dot com Status: Open Bug Type: Strings related Operating System: * PHP Version: 5.3.0 New Comment: Sorry but this issue is the same as bug #49785, isn't it? Previous Comments: ------------------------------------------------------------------------ [2009-10-08 14:15:55] hello at iwamot dot com Description: ------------ PHP 5 ChangelLog says "Fixed htmlentities/htmlspecialchars not to accept partial multibyte sequences." http://www.php.net/ChangeLog-5.php#5.2.5 But it has not been fixed in reality. Please correct the log, or investigate my patch. http://iwamot.com/misc/html.c.patch.20091008 Reproduce code: --------------- // Shift_JIS echo htmlspecialchars("\x80", ENT_QUOTES, 'Shift_JIS') . "!\n"; echo htmlspecialchars("\x81/", ENT_QUOTES, 'Shift_JIS') . "!\n"; // EUC-JP echo htmlspecialchars("\x80", ENT_QUOTES, 'EUC-JP') . "!\n"; echo htmlspecialchars("\xA1/", ENT_QUOTES, 'EUC-JP') . "!\n"; Expected result: ---------------- returning empty string (as well as my patch): ! ! ! ! or sanitizing: ! /! ! /! Actual result: -------------- _! _/! _! _/! ("_" means an invalid byte) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49814&edit=1

« previous php.bugs (#143412) next »