Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21359

Unproper encoded exif may break ezoe:browse functionality

    XMLWordPrintable

    Details

      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

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            joaquim.cavalleri-obsolete@ez.no Joaquim Cavalleri (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: