Hangs on corrupt file
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.7k
- Forks
- 579
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
I download a PDF file, and run the following code... which seems to just hang.
$parser = new PdfParser();
$pdf = $parser->parseFile( $saved_file );
$details = $pdf->getDetails();
When I download the file via a web-browser and try to open it, it says the PDF is corrupt.
Shouldn't this throw and exception or return NULL on corrupt files?
Contributor guide
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 PdfParser->parseFile(), using the corrupt PDF described in the report, and inspect how getDetails() behaves afterward. Confirm the expected handling for corrupt files—an exception or NULL—and verify that the parser no longer hangs.
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