When implementing htmlpurifier as a module on a multisite environment I encountered errors that the required library folder wasn't writable. Our security policies restrict writing in other environments than your own site for obvious reasons.

While debuging the code I found out that the packaged drupal defenition class wasn't used and the default serializer was used instead. Conform to the htmlpurifier documentation I set the "Cache.DefinitionImpl" configuration directive to "Drupal" inside the _htmlpurifier_get_config function.

This seems to have fixed the problem for me. Hope it helps.

CommentFileSizeAuthor
#1 300518.patch1.39 KBowen barton
cachefix.patch1011 bytesjoostpluijmers

Comments

owen barton’s picture

Version: 5.x-1.3 » 5.x-1.x-dev
StatusFileSize
new1.39 KB

Agreed on the need for this patch - it is bad form for Drupal to be writing any files outside of the configured directory.

Here is a patch that uses the standard method for creating and testing directories. It also uses the files directory, rather than the tmp directory (this cache can be permanent) which is in line with other caches (imagecache, css aggregation etc). It keeps the 2 directory levels, in case htmlpurifier needs additional caches in the future.

owen barton’s picture

Assigned: joostpluijmers » Unassigned
ezyang’s picture

Status: Needs review » Fixed

This was fixed a long time ago. :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.