summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-12-22 11:26:53 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-12-22 11:26:53 -0500
commitb5326b1de147f2b6433770b0b0fbab3c421b978a (patch)
tree2a429d5bb374a66ea3dbeae2219e9a5d31a432b2 /src/usr
parentede54eaad8b4ac7061228c6d83fa5dc3c4f3b6c6 (diff)
parent5736b2ce513ab3a9065f32f74a754ed4d815894a (diff)
downloadpfsense-b5326b1de147f2b6433770b0b0fbab3c421b978a.zip
pfsense-b5326b1de147f2b6433770b0b0fbab3c421b978a.tar.gz
Merge pull request #2316 from phil-davis/patch-3
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/classes/Form/Select.class.php11
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 = "&nbsp;";
+ }
+
+ $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
+}
OpenPOWER on IntegriCloud