ValueError: Path cannot be empty in file_put_contents()
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.4k
- Forks
- 361
- Avg merge
- 3d 41m
- Merged PRs (30d)
- 2
Description
The problem occurs here:
tempnam() can return false, which leads to file_put_contents() throwing ValueError: Path cannot be empty on PHP 8+.
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 library/HTMLPurifier/URIScheme/data.php lines 89-94 and inspect how tempnam() is used before file_put_contents(). Reproduce the failure on PHP 8+ and check the surrounding URI data handling. Done means tempnam() failure no longer reaches file_put_contents() with an invalid path, with the existing behavior preserved for successful temporary-file creation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100