From ff6c032073d176373596e3fd861007c0b9a42d94 Mon Sep 17 00:00:00 2001 From: David Windell Date: Wed, 20 Mar 2013 11:00:15 +0000 Subject: [PATCH] Fix array_fill error --- src/CollectionInputFilter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CollectionInputFilter.php b/src/CollectionInputFilter.php index e3766812..bdb83570 100644 --- a/src/CollectionInputFilter.php +++ b/src/CollectionInputFilter.php @@ -127,7 +127,11 @@ public function isValid() { $valid = true; - $inputCollection = array_fill(0, $this->getCount(), $this->validationGroup ?: array_keys($this->inputs)); + if ($this->getCount() < 1) { + return $valid; + } + + $inputCollection = array_fill(0, $this->getCount() , $this->validationGroup ?: array_keys($this->inputs)); foreach ($inputCollection as $key => $inputs) { $this->data = array();