this is probably well outside of this module's purpose, but any tips would be a huge help for my current situation.

i have a template that loads a node using the drupal function node_load(), which apparently doesn't always give you the 'safe' version of text content fields, only the unfiltered 'value' version. is there a way to apply html purifier to any string as a workaround for this limitation of node_load()?

Comments

ezyang’s picture

Do you want to use one of the configured filter formats, or do you need a custom set of configuration for the template?

mattgilbert’s picture

I want to use one of the configured filters. No need for a custom configuration, although if it's easier I would be fine with mimicking the configured filter in some other form.

mattgilbert’s picture

Priority: Normal » Minor

I've worked around this by hard-coding some preg_replace()s in the template. Still would be nice to have the actual (much better coded) filtering system available.

ezyang’s picture

Status: Active » Fixed

_htmlpurifier_process($html, $format_id) is the "private" function that does the filtering. I'm kind of hesitant recommending you use this; the alternative is to directly invoke htmlpurifier_filter() (which has the normal well defined *_filter() interface and is guaranteed to stay the same). Either should work.

Status: Fixed » Closed (fixed)

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