Set "URI.DefinitionID" and "URI.DefinitionRev" in HTMLPurifier

Bug #1558830 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Confirmed
Medium
Unassigned

Bug Description

While working on https://bugs.launchpad.net/mahara/+bug/1558387, Robert pointed out to me that we don't set URI.DefinitionRev. We also don't set URI.DefinitionID. Although the HTMLPurifier docs say that URI.DefinitionID is required if you have custom URIFilters (and our allowed iframe list is a custom URIFilter), it looks like the fallback behavior is that it generates a URI.DefinitionID based on a hash of the config. This has the effect that a new "Revision 1" URI config file is generated each time the allowed iframes list changes. It also results in an accumulation of old URI cache files in the dataroot/htmlpurifier directory, since they're all Revision 1, and all have different IDs.

I think the best approach here is to give the URI.DefinitionRev its own revision number, stored in the database, and increment it every time we change the allowed iframe list.

Tags: htmlpurifier
Changed in mahara:
milestone: none → 16.10.0
importance: Undecided → Medium
status: New → Confirmed
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 16.10.0 → 16.10.1
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 16.10.1 → 17.04.0
tags: added: htmlpurifier
Changed in mahara:
milestone: 17.04.0 → 17.10.0
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 17.10.0 → 18.04.0
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 18.04.0 → 18.10.0
Changed in mahara:
milestone: 18.10.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.