From 800411803c17c0883e6e28b3422e097d23c32dba Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Sat, 12 Sep 2015 15:04:49 +0000 Subject: [PATCH] dblayer : if the verify return an array with the field in key, the exception of update is now working git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2275 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dblayer.php b/dblayer.php index 85eeaea..a05b612 100644 --- a/dblayer.php +++ b/dblayer.php @@ -831,7 +831,12 @@ class dblayer if (count ($errors) !== 0) { if (is_array ($errors)) - throw new Exception ($errors[0][1], 405); + { + if (isset ($errors[0][1])) + throw new Exception ($errors[0][1], 405); + $err = reset ($errors); + throw new Exception ($err[1], 405); + } throw new Exception ($errors[1], 405); } foreach ($this->fields as $field=>$desc)