Details
-
Improvement
-
Resolution: Fixed
-
Medium
-
4.7.0
-
None
-
eZ Publish 4.7 on PHP Zend Server
Description
Although it's not always reproducible, in some environments the attempt to access ezoe::browse ezjscore call will result in no content, in result of a failure to parse as json, an array that includes non properly encoded UFT8 characters.
In these environments, a variation of the patch certified in https://jira.ez.no/browse/EZP-19929, replacing the mb_convert_encoding with a utf8_encode seems to solve the issue perfectly.
Please certify if this patch will not break eZ's stability and functionality
--- extension/ezjscore/classes/ezjscajaxcontent.php +++ extension/ezjscore/classes/ezjscajaxcontent.php @@ -460,7 +460,7 @@ // json_encode/xmlEncode need UTF8 encoded strings // (exif) metadata might not be for instance // see https://jira.ez.no/browse/EZP-19929 - if ( !utf8_encode( $element ) ) + if ( !mb_check_encoding( $element, 'UTF-8' ) ) { $element = utf8_encode( $element ); }
steps to reproduce.
- Load an image with non utf8 content in exif fields into a site
- in an xml block field, attempt to select the image through a insert/edit object or image function
- IF you're affected with the encoding problem, the popup window will be blank