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

ezxmltext ampersands are incorrectly turned into htmlentities twice

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 5.4.5
    • 5.4.4
    • Legacy stack
    • PHP 5.6.6
      libxml(libxml2) version 2.7.6
      CentOs & RHEL

    Description

      Ampersand characters (&) in the XML Text block are turned into & incorrectly on content publish.

      The issue seems to be with structHandler for element #text in the ezxmlinputhandler in eZ Publish Legacy.

      Before it is called the ampersands are correct.

      XML before callOutputHandler structHandler for element #text <kernel-datatype-ezxmltext>:
      <?xml version="1.0" encoding="utf-8"?>
      <section xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/">
      <paragraph>&amp;&lt;&gt;</paragraph>
      <paragraph/></section>
      

      But after it the ampresands get turned into html entities again breaking content.

       XML after callOutputHandler structHandler for element #text <kernel-datatype-ezxmltext>:
      <?xml version="1.0" encoding="utf-8"?>
      <section xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/">
      <paragraph>
      <line xmlns:tmp="http://ez.no/namespaces/ezpublish3/temporary/" tmp:new-element="true">
      &amp;amp;&amp;lt;&amp;gt;
      </line>
      </paragraph>
      <paragraph/></section>
      

      Steps to reproduce

      1. Log on to admin
      2. Create a new object from a class that has an XML Text block attribute
      3. In the Rich editor type in &<>
      4. Send to publish
      5. View the newly created object and check the XML Text attribue
        • You will see
          &amp;&lt;&gt;

          instead of &<>

      Attachments

        Activity

          People

            Unassigned Unassigned
            peter.halasz@ft.com peter.halasz@ft.com
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: