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
This commit is contained in:
2017-09-26 10:11:34 +00:00
parent f0b2d1193d
commit bacf9658b8

View File

@@ -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 .= " <option value='";
$res .= htmlspecialchars ($key, ENT_QUOTES)."'";
if (isset ($this->values) &&