Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Request #18251 A fix for checking the record length
Submitted: 2011-02-08 06:49 UTC
From: crishoj Assigned: dbs
Status: Closed Package: File_MARC (version 0.6.1)
PHP Version: 5.3.5 OS: Ubuntu
Roadmaps: (Not assigned)    
Subscription  


 [2011-02-08 06:49 UTC] crishoj (Christian Rishøj)
Description: ------------ In version 0.6.1, the code would rely on the match data from the regular expression matching, even if it didn't match. Expected result: ---------------- No warnings. Actual result: -------------- Warnings on accessing $matches[1]

Comments

 [2011-02-08 06:49 UTC] crishoj (Christian Rishøj)
Added patch fix.
 [2011-02-08 09:00 UTC] dbs (Dan Scott)
The patch looks good on the face of it, but could you add a sample record (or even better, a unit test with a sample record) that triggers the current bug?
 [2011-02-09 02:33 UTC] dbs (Dan Scott)
-Status: Open +Status: Closed -Assigned To: +Assigned To: dbs
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Committed your patch as 308144 and added a further piece to prefer the actual length of the data to the length declared in the leader, if they don't match. Thanks!
 [2011-02-09 04:32 UTC] crishoj (Christian Rishøj)
I can attach a sample MARC file which will cause the error upon calling next() when the last record has been reached. I can't see any way to attach files in this bug tracker, so I am placing it here instead: https://public.me.com/ix/crishoj/UGE1052S.S00
 [2011-02-09 11:00 UTC] dbs (Dan Scott)
Great -thanks! I have confirmed that the 0.6.2 release resolves this problem.
 [2011-02-09 11:01 UTC] dbs (Dan Scott)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/ Release 0.6.2 earlier today to address this problem and several other similar ones.