Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26423

Add option so that format_text (with htmlpurifier) does not remove id attribute

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0.3
    • 2.0.2
    • Libraries
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Moderate

      With htmlpurifier enabled, format_text removes the 'id' attribute. This causes a problem for the ouwiki module, which uses id to store data associated with the user content.

      I propose to change format_text to add a new option

      allowid = true (default false); allow the id attribute to be preserved even when cleaning is applied

      If set, this will pass through eventually to HTMLPurifier as
      $config->set('HTML.EnableAttrID', true)

      (When htmlpurifier is not enabled, there is no need to pass it through to the 'old' cleaning method, as that one does not remove id attribute anyway)

      Petr has agreed this is a reasonable approach and we can submit a PULL request for 2.0.3, subject to review.

            quen Sam Marshall
            quen Sam Marshall
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.