From bacf9658b8a019a71718435d54707f51c2d13769 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 26 Sep 2017 10:11:34 +0000 Subject: [PATCH] form: raise an exception if a default value is not a string git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3958 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- form.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/form.php b/form.php index e42a942..15f4f84 100644 --- a/form.php +++ b/form.php @@ -781,6 +781,9 @@ class formfield $res .= ">\n"; foreach ($this->defaults as $key=>$val) { + if (! is_string ($val)) + throw new \Exception ("Value as defaut for $this->name::$key is not ". + "a string (".gettype ($val).")"); $res .= "