fputcsv does not escape escape characters
Open
Nobody has claimed this yet.
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
$out = fopen('php://output', 'w');
fputcsv($out, array('ab\\'));
fclose($out);
Output:
"ab\"
This should be outputting an escaped backslash ("ab\\"). Likewise, explicitly named escape characters in a string will not be escaped. Eg:
$out = fopen('php://output', 'w');
fputcsv($out, array('a:b'), ",", "\"", ":");
fclose($out);
Output:
"a:b"
Tested on PHP 8.0 and 8.2
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 with the PHP documentation entry for fputcsv and review how it describes the escape character, using the two reported examples as checks. Update the relevant explanation or examples so backslashes and explicitly supplied escape characters are accurately documented, then verify the wording against the observed PHP 8.0 and 8.2 output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100