ZF-12279: Dirty code in Zend_Pdf_Parser
Description
Replace
// Force $objectOffset to be treated as decimal instead of octal number
for ($numStart = 0; $numStart < strlen($objectOffset)-1; $numStart++) {
if ($objectOffset[$numStart] != '0') {
break;
}
}
$objectOffset = substr($objectOffset, $numStart);
With
$objectOffset = ltrim($objectOffset, '0');
Comments
Posted by Sergey Kolodyazhnyy (sergeykolodyazhnyy) on 2012-06-12T08:24:42.000+0000
There a lot of this code entries in Zend_Pdf_Parser, even not as separate method
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2012-06-13T11:22:58.000+0000
Sergey,
Thank you for reporting this issue. Could you perhaps supply a patch that contains the improvements you think can be made? Also, I'm not sure what the incentive was to do it like this. Please make sure you run the test suite to ensure we don't break anything here ;)
Thanks.