laravel/laravel — pull request #1134 by half-evil (2012-08-22 10:44:17+00:00)
Title: Fix for the validate_match function

## Bug

You can't use a ',' in a regex string of a match validation rule. If you apply a validation rule like `match:/^[0-9]{1,10}/`, you would encounter the error `preg_match(): No ending delimiter '/' found`. This happens because the parameter `/^[0-9]{1,10}/` is splited on the ',' into an array and only the first element of that array is passed to the `preg_match()` function (see line 645):

protected function validate_match($attribute, $value, $parameters)
{
return preg_match($parameters[0], $value);

}

## Fix

Joining the parameter array into a string and pass it to the `preg_match()` function.

protected function validate_match($attribute, $value, $parameters)
{
return preg_match(join(",", $parameters), $value);
}

Happy coding,
Christian