stevebauman/purify

Cache.DefinitionImpl / Cache.SerializerPath is ignored

Closed this issue ยท 7 comments

I have HTMLPurifier 4.15.0 from PEAR on an ubuntu server 22.04.
I've set
$config->set('Cache.DefinitionImpl', null);
but I'm still seeing this warning:
/usr/share/php/HTMLPurifier/DefinitionCache/Serializer.php(297): Directory /usr/share/php/HTMLPurifier/DefinitionCache/Serializer not writable, please chmod to 777
If I set:
$config->set('Cache.SerializerPath', '/some/dir'); // which is writable by the web server
the exact same warning still appears mentioning DefinitionCache/Serializer not my directory.
I can't set the permissions of the default directory because I have no access and I don't need caching anyway because I'm doing inbound filtering.

Sorry, this was the wrong place to report this.

@sogerc1 Can you link to wherever you ultimately reported this? I am having the same issue. Thanks!

EDIT: you know what, I just realized I'm like 3 major versions behind. Fixing that might do the trick!

@chuck-wood Here:
ezyang/htmlpurifier#370
but no response there either.

Do either of you encounter this issue when disabling caching all-together in the config?

https://github.com/stevebauman/purify#disabling-caching

// config/purify.php

'serializer' => null,

@stevebauman To be honest not long after I wrote these reports it became a non issue for me because it has been decided that the website is not a storage website so we don't care about preserving user input.
But thank you anyway for the response, I'll write it down and I'll see if it applies to the ezyang version in case I'll ever need it again.

Hey @stevebauman, thanks for responding! This morning I realized that I was passing additional config into the call to Purify::clean, and that I had just previously read somewhere that additional config is not merged, but replaces the existing config. So, I fixed that issue (by array_merge'ing the new config with the base config at the call site), and that resolved the issue. Thanks for following up!

@sogerc1 Ok thanks! Appreciate it ๐Ÿ‘

@chuck-wood Okay great that's good to hear it's working and that you're up and running! Happy to help ๐Ÿ™