Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-7284

Global field validators configuration

XMLWordPrintable

    • Yes
    • Nucleus 13, Nucleus 14
    • 5

      Due to the introduction of SafeHtmlValidator in Magnolia 6.2.20, there are validation errors for some tags that are not included in the validator but are needed by the users.

      Reproduce

      • Create a new page in demo author (basic template)
      • Add a text and image component
      • Add a link in the rich text field and go to the advanced tab to select left to right orientation (LTR) so the non-included tag is added
      • Save the form

      Expected
      The dialog is saved

      Actual
      The dialog is not saved due to validation error: Malicious HTML code found

      Notes
      The value of allowed tags is hardcoded in SafeHtmlValidatorFactory, it would be good if those were configurable somewhere else so, if needed, users could add new allowed tags. If not possible to be configurable, more tags should be added to the list of allowed attributes (at least those that can be used in default CKEditor configuration)

      Workaround
      Override the SafeHtmlValidatorFactory on a custom Java module and set the tags you want to use in there as valid HTML tags.
      OR
      Disable the validator on the richtext-field until the release of 6.2.21

      validators:
        allowAny:
          $type: null
      

      Fix
      Fixed in Magnolia 6.2.21. See the section on Global Validators.

        Acceptance criteria

              rkovarik Roman Kovařík
              jayala Jonathan Ayala
              Nucleus
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 5d 7.5h
                  5d 7.5h