What the shit? PHP Fatal error: Call to undefined method HTMLPurifier_URIFilter_TransformImageScheme::postFilter()

16 views
Skip to first unread message

Konstantin Panfilov

unread,
Nov 9, 2017, 7:32:32 AM11/9/17
to htmlpurifier
i'm use this example http://repo.or.cz/htmlpurifier.git/blob/HEAD:/library/HTMLPurifier/URIFilter/MakeAbsolute.php
for create my custom url filter
but have much errors on init code like topic
no any info about need declare preFilter and postFilter methods - only reverse engine 
and second one: why try call method without check method_exists() - it's very stupid 

Konstantin Panfilov

unread,
Nov 9, 2017, 8:09:01 AM11/9/17
to htmlpurifier
Please fix
HTMLPurifier.php(201-203) - (222-224) same for postFilter

for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) {
            if(!method_exists($filters[$i], 'preFilter')) { continue; }
            $html = $filters[$i]->preFilter($html, $config, $context);
        }


Edward Z. Yang

unread,
Nov 11, 2017, 9:37:53 AM11/11/17
to Konstantin Panfilov, htmlpurifier
Hi Konstantin,

You've confused URIFilter (which doesn't havea preFilter) and Filter
(which does have a preFilter). Look at the docs of HTMLPurifier_Filter
to see what these do.

Edward

Excerpts from Konstantin Panfilov's message of 2017-11-09 04:32:32 -0800:
Reply all
Reply to author
Forward
0 new messages