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:
3
form.php
3
form.php
@@ -781,6 +781,9 @@ class formfield
|
|||||||
$res .= ">\n";
|
$res .= ">\n";
|
||||||
foreach ($this->defaults as $key=>$val)
|
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 .= " <option value='";
|
||||||
$res .= htmlspecialchars ($key, ENT_QUOTES)."'";
|
$res .= htmlspecialchars ($key, ENT_QUOTES)."'";
|
||||||
if (isset ($this->values) &&
|
if (isset ($this->values) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user