From c729a0c4acb1fe9ee4aba6b0015d5d64d54a40f7 Mon Sep 17 00:00:00 2001 From: Elizabeth M Smith Date: Fri, 23 Jun 2017 13:41:39 -0400 Subject: [PATCH] avoids php blowing up if an array value is passed if incoming data has an array value set with a slug rule on it, you get preg_match() expects parameter 2 to be string, array given vendor\vlucas\valitron\src\Valitron\Validator.php:571 --- src/Valitron/Validator.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index 5fc5c84..f6bd446 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -565,6 +565,9 @@ class Validator */ protected function validateSlug($field, $value) { + if(is_array($value)) { + return false; + } return preg_match('/^([-a-z0-9_-])+$/i', $value); }