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) logged work - 05/Aug/13 2:00 AM
          • Time Spent:
            3 hours
             

            .

          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
          Show
          Yannick Roger (Inactive) added a comment - PR : https://github.com/ezsystems/ezpublish-legacy/pull/707
          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) logged work - 06/Aug/13 3:42 PM - edited
          • Time Spent:
            5 hours
             

            .

          Show
          Yannick Roger (Inactive) added a comment - Fixed in master : https://github.com/ezsystems/ezpublish-legacy/commit/a01bc57bce8aaa9e28fc5cee115573d73bb7d2a9
          Yannick Roger (Inactive) logged work - 07/Aug/13 12:20 PM
          • Time Spent:
            2 hours
             

            tests on 4.7 sp

          Pedro Resende (Inactive) logged work - 07/Aug/13 12:22 PM
          • Time Spent:
            30 minutes
             

            Test patch

          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) logged work - 07/Aug/13 3:55 PM
          • Time Spent:
            1 hour
             

            .

          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) logged work - 08/Aug/13 10:23 AM
          • Time Spent:
            5 hours
             

            Prepare new environment and test issue

          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 ]
          Patrick Allaert (Inactive) logged work - 12/Aug/13 12:34 PM
          Pedro Resende (Inactive) made changes -
          Rank Ranked lower
          Pedro Resende (Inactive) made changes -
          Rank Ranked lower
          Pedro Resende (Inactive) logged work - 13/Aug/13 3:46 PM
          • Time Spent:
            2 hours
             

            Work on story

          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 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          2m 29s 1 joaquim.cavalleri@ez.no 29/Jul/13 5:33 PM
          Confirmed Confirmed InputQ InputQ
          1d 18h 31m 1 Gunnstein Lye 31/Jul/13 12:05 PM
          Development Development Development Review Development Review
          21h 16m 1 yannick.roger@ez.no 06/Aug/13 1:43 PM
          Development Review Development Review Development Review done Development Review done
          1d 1 yannick.roger@ez.no 07/Aug/13 1:43 PM
          Development Review done Development Review done Documentation Review done Documentation Review done
          9m 17s 1 yannick.roger@ez.no 07/Aug/13 1:53 PM
          QA QA InputQ InputQ
          20m 29s 1 pedro.resende@ez.no 07/Aug/13 3:44 PM
          InputQ InputQ Development Development
          5d 4h 44m 2 yannick.roger@ez.no 07/Aug/13 4:07 PM
          Development Development Documentation Review done Documentation Review done
          4d 19h 31m 1 yannick.roger@ez.no 12/Aug/13 11:39 AM
          Documentation Review done Documentation Review done QA QA
          2h 24m 2 pedro.resende@ez.no 12/Aug/13 12:33 PM
          QA QA Closed Closed
          1d 4h 5m 1 pedro.resende@ez.no 13/Aug/13 4:39 PM
          Closed Closed Reopened Reopened
          2h 7m 1 André Rømcke 13/Aug/13 6:47 PM
          Reopened Reopened Closed Closed
          8m 52s 1 André Rømcke 13/Aug/13 6:55 PM

            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