ezyang / ezyang/htmlpurifier

Cache.DefinitionImpl / Cache.SerializerPath ignored

Open
#370 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

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 add:
$config->set('Cache.SerializerPath', '/some/dir'); // which is writable by the web server
the exact same warning still appears (still 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in DefinitionCache/Serializer.php around line 297 and trace how Cache.DefinitionImpl and Cache.SerializerPath are read from the configuration. Reproduce the warning with caching disabled and with a writable serializer path, then verify that the configured behavior is honored without referencing the unwritable default directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.