PUGX / shortid-php

An implementation of ShortId in PHP
MIT License
51 stars 7 forks source link

Shortid isValid() #4

Closed Dimentar closed 8 years ago

Dimentar commented 8 years ago

Bug for the values that has special regex characters: . \ + * ? [ ^ ] $ ( ) { } = ! < > | : - The line must be:

$ok = preg_match('/(['.$alphabet.']{'.$length.'})/', $value, $matches);

The searched $value must not be converted to preg_quote(), even if contains special regex characters.