PUGX / shortid-php

An implementation of ShortId in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shortid isValid()

Dimentar opened this issue · comments

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.