diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-22 11:26:53 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-22 11:26:53 -0500 |
commit | b5326b1de147f2b6433770b0b0fbab3c421b978a (patch) | |
tree | 2a429d5bb374a66ea3dbeae2219e9a5d31a432b2 /src/usr/local | |
parent | ede54eaad8b4ac7061228c6d83fa5dc3c4f3b6c6 (diff) | |
parent | 5736b2ce513ab3a9065f32f74a754ed4d815894a (diff) | |
download | pfsense-b5326b1de147f2b6433770b0b0fbab3c421b978a.zip pfsense-b5326b1de147f2b6433770b0b0fbab3c421b978a.tar.gz |
Merge pull request #2316 from phil-davis/patch-3
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/classes/Form/Select.class.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/usr/local/www/classes/Form/Select.class.php b/src/usr/local/www/classes/Form/Select.class.php index c7d73c1..13c49f7 100644 --- a/src/usr/local/www/classes/Form/Select.class.php +++ b/src/usr/local/www/classes/Form/Select.class.php @@ -66,7 +66,14 @@ class Form_Select extends Form_Input $selected = ($sval == $value); } - $options .= '<option value="'. htmlspecialchars($value) .'"'.($selected ? ' selected' : '').'>'. htmlspecialchars(gettext($name)) .'</option>'; + if (!empty(trim($name)) || is_numeric($name)) { + $name_str = htmlspecialchars(gettext($name)); + } else { + // Fixes HTML5 validation: Element option without attribute label must not be empty + $name_str = " "; + } + + $options .= '<option value="'. htmlspecialchars($value) .'"'.($selected ? ' selected' : '').'>'. $name_str .'</option>'; } return <<<EOT @@ -75,4 +82,4 @@ class Form_Select extends Form_Input </select> EOT; } -}
\ No newline at end of file +} |