Cache directory should default to PHP temporary directory
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.4k
- Forks
- 361
- Avg merge
- 3d 41m
- Merged PRs (30d)
- 2
Description
A site using htmlpurifier as part of a deployable artifact doesn't have access to write to the codebase, but htmlpurifier defaults to writing within the codebase, specifically:
Directory .../sites/all/libraries/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer not writable, please chmod to 777
File .../sites/all/libraries/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php, line 278
The library should instead default to PHP's built-in temporary directory support.
Also, 777 is an extremely unsafe permission and should not be recommended, especially on a webserver.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at HTMLPurifier/DefinitionCache/Serializer.php around line 278 and inspect how the cache directory is selected and its permissions are reported. Compare that behavior with PHP's built-in temporary-directory support; done means deployable sites can use the default without writing to the codebase and the unsafe 777 recommendation is removed.
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
- 38/100