In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1423 [In-Portal CMS] Data Management bug report always 2012-11-02 06:50 2012-11-02 09:18
alex  
alex  
normal  
resolved 5.2.0  
fixed  
 
none 5.2.1-B1  
https://groups.google.com/d/topic/in-portal-bugs/U6jKZhLplbQ/discussion
Fixes charset encoding problem from htmlspecialchars function
1
0001423: Function "htmlspecialchars" breaks down UTF-8 encoding
I didn't new before, but function "htmlspecialchars" not only escapes text to be safe for usage inside a HTML/XML, but also converts it's encoding to ISO-8859-1 (PHP 5.3.x and below).
As a result any UTF-8 encoded string will be encoded into ISO-8859-1 (after escaping) and all special symbols (e.g. resulted from pasting text from Microsoft Word) would have incorrect encoding, when presented back to user who has UTF-8 encoding on a page.

In PHP 5.4 and up default charset for this function is UTF-8.


As a fix I propose to pass CHARSET constant's value explicitly in each call of htmlspecialchars function across all In-Portal and it's modules.
related to 0001342closed  (5.2.0)alex Make UTF-8 the only one supported language encoding 
patch htmlspecialchars_encoding_core_fix.patch (15,383) 2012-11-02 09:13
http://tracker.in-portal.org/file_download.php?file_id=1845&type=bug
patch htmlspecialchars_encoding_modules_fix.patch (7,207) 2012-11-02 09:13
http://tracker.in-portal.org/file_download.php?file_id=1846&type=bug
Issue History
2012-11-02 09:18 alex Note Added: 0005251
2012-11-02 09:18 alex Status reviewed and tested => resolved
2012-11-02 09:18 alex Fixed in Version => 5.2.1-B1
2012-11-02 09:18 alex Resolution open => fixed
2012-11-02 09:18 alex Assigned To !COMMUNITY => alex
2012-11-02 09:18 alex Changeset attached 5.2.x r15601
2012-11-02 09:17 alex Changeset attached 5.2.x r15600
2012-11-02 09:17 alex Changeset attached 5.2.x r15599
2012-11-02 09:15 alex Note Added: 0005250
2012-11-02 09:15 alex Status needs testing => reviewed and tested
2012-11-02 09:15 alex Assigned To => !COMMUNITY
2012-11-02 09:15 alex Developer => alex
2012-11-02 09:15 alex Status active => needs testing
2012-11-02 09:13 alex File Added: htmlspecialchars_encoding_modules_fix.patch
2012-11-02 09:13 alex File Added: htmlspecialchars_encoding_core_fix.patch
2012-11-02 08:54 alex Relationship added related to 0001342
2012-11-02 06:50 alex version => 5.2.0
2012-11-02 06:50 alex Target Version => 5.2.1
2012-11-02 06:50 alex New Issue
2012-11-02 06:50 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/U6jKZhLplbQ/discussion
2012-11-02 06:50 alex Change Log Message => Fixes charset encoding problem from htmlspecialchars function
2012-11-02 06:50 alex Estimate Points => 1

Notes
(0005250)
alex   
2012-11-02 09:15   
Will test all together later.
(0005251)
alex   
2012-11-02 09:18   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001423: Function "htmlspecialchars" breaks down UTF-8 encoding