From bb37b9200a2c611886bd759af27a9af8865cd6a7 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 19 May 2017 17:55:07 +0000 Subject: [PATCH] dblayeroo: check if table name and primary key is defined before verify an entry git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3707 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayeroo.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dblayeroo.php b/dblayeroo.php index 1c32a60..eaa7ef3 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -2299,6 +2299,11 @@ class dblayeroo { $update = !! $update; $errors = array (); + if ($this->table === null) + throw new \Exception ("No table name defined", 500); + if ($this->primary === null) + throw new \Exception ("No primary key defined for table '$this->table'", + 500); if ($update === false) { // INSERT mode