Skip to content

length should not invalidate bar code. #9

@proseLA

Description

@proseLA

i have encountered manufacturers who are using a 2 digit suffix at the end of the 12 digit UPC bar code. the 2 digit suffix indicates a packaging of some sort. you are returning false if the length is not the expected length.

// Check if the string length matches the code's desired length
if (strlen($code) == $length) {

here is one such code: 84788101273501

upczilla does validate this code as true while your validator automatically returns false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions