Skip to content

Challenges with purifier module and HTMLPurifier #23

@gene1wood

Description

@gene1wood

I had challenges getting gallery3 (galleryrevival) working due to the purifier module.

I ended up just removing the gallery3/modules/purifier directory and got it working. I thought I'd report it here in case it is an actual problem.

I followed the steps in the Dockerfile to integrate the gallery3-contrib modules and themes into the installation.

When I run gallery3 though, visiting the site produces this error in the logs

2022-12-03 23:34:24 -08:00 --- error: Error [ 0 ]: Class "HTMLPurifier_Config" not found
/config/gallery3/modules/purifier/helpers/purifier.php [ 24 ]
#0 /config/gallery3/modules/gallery/libraries/SafeString.php(157): purifier::purify()
#1 /config/gallery3/modules/gallery/libraries/SafeString.php(56): SafeString_Core::_purify_for_html()
#2 /config/gallery3/modules/gallery/helpers/MY_html.php(46): SafeString_Core::purify()
#3 /config/gallery3/themes/wind/views/page.html.php(13): html::purify()
#4 /config/gallery3/system/libraries/View.php(318): include('...')
#5 /config/gallery3/system/libraries/View.php(260): View_Core->load_view()
#6 /config/gallery3/modules/gallery/libraries/MY_View.php(75): View_Core->render()
#7 /config/gallery3/system/libraries/View.php(226): View->render()
#8 /config/gallery3/modules/gallery/controllers/albums.php(77): View_Core->__toString()
#9 /config/gallery3/modules/gallery/controllers/albums.php(22): Albums_Controller->show()
#10 [internal function]: Albums_Controller->index()
#11 /config/gallery3/system/core/Kohana.php(302): ReflectionMethod->invokeArgs()
#12 /config/gallery3/system/core/Event.php(208): Kohana_Core::instance()
#13 /config/gallery3/application/Bootstrap.php(67): Event_Core::run()
#14 /config/gallery3/index.php(124): require('...')
#15 {main}

I tried working around this based on this note in the module.info

Enable XSS protection using HTMLPurifier; add ezyang/htmlpurifier: ^4.13 to composer.json and run composer update

By adding it to composer.json and installing it.

This didn't resolve the error for me though.

7 also tried copying the vendored HTMLPurifier from the original gallery3-contribs into the gallery3/modules/purifier/vendor directory. This also didn't work for me.

Finally I tried extracting the standalone package of HTMLPurifier into the gallery3/vendor directory. But I gave up on trying to figure out how to get autoload.php to load in this standalone package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions