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


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);


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

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

Fixed with r11791 by andries.

Changing issues in preparation for the 1.7.0 release.