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

ezjscAjaxContent : Image's exif fields MakerNote and UserComment must be base64 encoded

    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.

      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
      1. php.ini
        68 kB
        Pedro Resende

        Issue Links

          Activity

          Joaquim Cavalleri (Inactive) created issue -
          Joaquim Cavalleri (Inactive) made changes -
          Field Original Value New Value
          Status Open [ 1 ] Confirmed [ 10037 ]
          Joaquim Cavalleri (Inactive) made changes -
          Summary Unproper encoded exif may break ezoe:browse functiuonality Unproper encoded exif may break ezoe:browse functionality
          Joaquim Cavalleri (Inactive) made changes -
          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
          {code}
          --- 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 );
                                       }
          {code}
          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
          {code}
          --- 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 );
                                       }
          {code}

          h5. 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
          Joaquim Cavalleri (Inactive) made changes -
          Component/s Extensions/eZ JSCore [ 10802 ]
          Gunnstein Lye made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          Damien Pobel (Inactive) made changes -
          Link This issue relates to EZP-19929 [ EZP-19929 ]
          Yannick Roger (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ]
          Yannick Roger (Inactive) made changes -
          Environment eZ Publish 4.7 on PHP Zend Server eZ Publish 4.7 on PHP Zend Server PHP 5.3.14
          Yannick Roger (Inactive) made changes -
          Summary Unproper encoded exif may break ezoe:browse functionality ezjscAjaxContent : Image's exif fields MakerNote and UserComment must be base64 encoded
          Yannick Roger (Inactive) made changes -
          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
          {code}
          --- 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 );
                                       }
          {code}

          h5. 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
          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.

          h5. 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
          Yannick Roger (Inactive) made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 2 hours [ 7200 ]
          Worklog Id 37721 [ 37721 ]
          Yannick Roger (Inactive) made changes -
          Time Spent 2 hours [ 7200 ] 5 hours [ 18000 ]
          Worklog Id 37722 [ 37722 ]
          Yannick Roger (Inactive) made changes -
          Time Spent 5 hours [ 18000 ] 6 hours [ 21600 ]
          Worklog Id 37721 [ 37721 ]
          Yannick Roger (Inactive) made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Yannick Roger (Inactive) made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Yannick Roger (Inactive) made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Affects Version/s 5.1 [ 11280 ]
          Affects Version/s 5.0 [ 10300 ]
          Affects Version/s 5.2-dev [ 12300 ]
          Fix Version/s 5.2-dev [ 12300 ]
          Fix Version/s 5.1 [ 11280 ]
          Fix Version/s 5.0 [ 10300 ]
          Fix Version/s 4.7.0 [ 11010 ]
          Yannick Roger (Inactive) made changes -
          Time Spent 6 hours [ 21600 ] 1 day [ 28800 ]
          Worklog Id 37721 [ 37721 ]
          Yannick Roger (Inactive) made changes -
          Time Spent 1 day [ 28800 ] 1 day, 1 hour [ 32400 ]
          Worklog Id 37762 [ 37762 ]
          Pedro Resende (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ] Pedro Resende [ pedro.resende@ez.no ]
          Pedro Resende (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Pedro Resende [ pedro.resende@ez.no ]
          Pedro Resende (Inactive) made changes -
          Time Spent 1 day, 1 hour [ 32400 ] 1 day, 1 hour, 30 minutes [ 34200 ]
          Worklog Id 37765 [ 37765 ]
          Yannick Roger (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ]
          Yannick Roger (Inactive) made changes -
          Time Spent 1 day, 1 hour, 30 minutes [ 34200 ] 1 day, 3 hours, 30 minutes [ 41400 ]
          Worklog Id 37779 [ 37779 ]
          Pedro Resende (Inactive) made changes -
          Time Spent 1 day, 3 hours, 30 minutes [ 41400 ] 2 days, 30 minutes [ 59400 ]
          Worklog Id 37789 [ 37789 ]
          Pedro Resende (Inactive) made changes -
          Attachment php.ini [ 16336 ]
          Patrick Allaert (Inactive) made changes -
          Time Spent 2 days, 30 minutes [ 59400 ] 2 days, 50 minutes [ 60600 ]
          Worklog Id 37841 [ 37841 ]
          Yannick Roger (Inactive) made changes -
          Link This issue is blocked by EZP-21396 [ EZP-21396 ]
          Yannick Roger (Inactive) made changes -
          Status Development [ 3 ] Documentation done [ 10011 ]
          Pedro Resende (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ] Pedro Resende [ pedro.resende@ez.no ]
          Pedro Resende (Inactive) made changes -
          Rank Ranked lower
          Pedro Resende (Inactive) made changes -
          Rank Ranked lower
          Pedro Resende (Inactive) made changes -
          Time Spent 2 days, 50 minutes [ 60600 ] 2 days, 2 hours, 50 minutes [ 67800 ]
          Worklog Id 37933 [ 37933 ]
          Pedro Resende (Inactive) made changes -
          Assignee Pedro Resende [ pedro.resende@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          André Rømcke made changes -
          Fix Version/s 5.0-SP [ 11287 ]
          Fix Version/s 5.1-SPx [ 12301 ]
          Fix Version/s 5.2 [ 11281 ]
          Fix Version/s 5.0 [ 10300 ]
          Fix Version/s 4.7.0 [ 11010 ]
          Fix Version/s 5.1 [ 11280 ]
          Fix Version/s 5.2-dev [ 12300 ]
          André Rømcke made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 57186 ] EZ* Development Workflow [ 84103 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 84103 ] EZEE Development Workflow [ 122739 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Joaquim Cavalleri (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 2 hours, 50 minutes
                2d 2h 50m