projects
/
php-utility-classes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0fe0566
)
make sure that values like '0' are valid in select options
author
Robert Kaiser
<kairo@kairo.at>
Fri, 12 Apr 2024 23:33:47 +0000
(
01:33
+0200)
committer
Robert Kaiser
<kairo@kairo.at>
Fri, 12 Apr 2024 23:33:47 +0000
(
01:33
+0200)
classes/document.php-class
patch
|
blob
|
blame
|
history
diff --git
a/classes/document.php-class
b/classes/document.php-class
index ebde6ec965f8ec52f16bbfaa6f40610519351e7e..c2f0fcfe0d9107d7baf897774dd79bda2d2f44f7 100755
(executable)
--- a/
classes/document.php-class
+++ b/
classes/document.php-class
@@
-687,10
+687,12
@@
class ExtendedDocument extends DOMDocument {
public function createElementOption($key, $desc, $selected = false) {
$option = $this->createElement('option', $desc);
- if (
$key
) {
+ if (
is_numeric($key) || is_string($key)
) {
$option->setAttribute('value', $key);
}
- if ($selected) { $option->setAttribute('selected', ''); }
+ if ($selected) {
+ $option->setAttribute('selected', '');
+ }
return $option;
}