ZF-4747: Zend_Validate_Barcode::isValid($ean13) incorrectly assumes $ean13 only contains valid characters

Issue Type: Bug Created: 2008-10-29T21:16:34.000+0000 Last Updated: 2008-11-13T14:10:11.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Jason "p0windah" Chow (p0windah) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: Attachments:


note Consider this post Public Domain.

//example of incorrect assumption leading to wrong result $invalid_ean13 = 'Tree to Table'; $validate = new Zend_Validate_Barcode('ean13'); $valid = $validate->isValid($invalid_ean13); if ( $valid ) { die('this is very wrong'); }

//suggested solution, insert at start of isValid() in Zend/Validate/Barcode/Ean13.php $valueString = preg_replace("/[^0-9]/i", '', $valueString);


Posted by Dave Hall (skwashd) on 2008-10-29T21:21:01.000+0000

The preg_replace should be preg_replace("/[^0-9]/i", '', $valueString);

I suspect you are getting ISBN10 and EAN13/ISBN13 confused :)

Posted by Thomas Weidner (thomas) on 2008-11-06T12:18:09.000+0000

Fixed with r11791 by andries.

Posted by Wil Sinclair (wil) on 2008-11-13T14:10:11.000+0000

Changing issues in preparation for the 1.7.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.