CRM-17962 HTML signature is escaped in profile editing and mailing

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7, 4.7.1, 4.7.2
    • Fix Version/s: None
    • Component/s: CiviMail, Core CiviCRM
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      On a fresh CiviCRM 4.7 installation, I've set an HTML signature for a contact using CKEditor. When I try to modify the contact, the HTML signature contains the escaped HTML code. The same appends when creating a mailing with {contact.signature} inside. However, the signature displays well for simple emails.

      This issue does not happen in 4.6. I've compared both databases and discovered that the HTML code stored in civicrm_email.signature_html is escaped in 4.7 but not in 4.6. Also, for simple emails, the signature is retrieved from an API call - I presume it unescapes the response.

      Is it intentional to store an escaped HTML signature in the database, is it a mistakes in CKEditor configuration or something else?

      Thanks in advance!

        Attachments

          Activity

          [CRM-17962] HTML signature is escaped in profile editing and mailing
          Jérôme Lebleu added a comment -

          Here is a quick and dirty patch to unescape the HTML signature before the database insert/update, but I believe there is a better fix - e.g. do not escape it, or unescape it after the database query, depending on your answer...

          Coleman Watts added a comment -

          We fixed something similar in 4.7.1 - can you try that version?

          Jérôme Lebleu added a comment -

          I tried again with 4.7.1 version, the issue is still there...

          Jérôme Lebleu added a comment -

          Still not fixed in 4.7.2... I would be glad to contribute and fix that, but I just don't know if the signature is stored escaped deliberately and if not, where it's taking place...

          Jérôme Lebleu added a comment -

          Thanks for the fix!

          Rohan Ramesh Katkar added a comment -

          Tested above PR.. works fine..

            People

            • Assignee:
              Rohan Ramesh Katkar
              Reporter:
              Jérôme Lebleu

              Dates

              • Created:
                Updated:
                Resolved: