ZF-1964: Add file validation method to Zend_Pdf
Description
Add a method (static?) to Zend_Pdf to validate whether or not a file is a PDF, regardless of assumed mime type or extension.
Add a method (static?) to Zend_Pdf to validate whether or not a file is a PDF, regardless of assumed mime type or extension.
Comments
Posted by Darby Felton (darby) on 2007-09-19T11:34:12.000+0000
Assigning to [~alexander] to initiate issue review.
Posted by Wil Sinclair (wil) on 2008-04-18T13:12:00.000+0000
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Posted by Willie Alberty (willie) on 2008-12-04T22:34:54.000+0000
Unassigning Zend_Pdf issues currently assigned to me pending decision on ZF 2.0 release timeframe and potential contribution of comprehensive changeset.
Posted by Wil Sinclair (wil) on 2008-12-08T16:43:02.000+0000
Alex, please evaluate and decide if/how we should act on this.
Posted by Daniel Remeseiro (jipipayo) on 2011-10-03T11:00:30.000+0000
Hi, i made this method to be added to Zend_Pdf to check if a file is a valid PDF:
Posted by Daniel Remeseiro (jipipayo) on 2011-10-03T11:01:38.000+0000
ups, it seems the jira dont parse php code on wiki :(
Posted by Daniel Remeseiro (jipipayo) on 2011-10-04T07:34:50.000+0000
i saw this method is not needed because zf always check this on construct method (so forget about my method):
on Library/Zend/Parser.php (lines 393-397)
$pdfVersionComment = $this->_stringParser->readComment(); if (substr($pdfVersionComment, 0, 5) != '%PDF-') { require_once 'Zend/Pdf/Exception.php'; throw new Zend_Pdf_Exception('File is not a PDF.'); }