1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-15 03:56:20 +02:00

e_form: Allow HTML attribute "value" keys with blank values

Otherwise, something like `<option>Nope</option>` will get a value of
"Nope" instead of "" as in `<option value=''>Nope</option>`.
This commit is contained in:
Nick Liu
2021-10-08 18:03:44 -05:00
parent 091145c1fe
commit 840e818f40
2 changed files with 5 additions and 5 deletions

View File

@ -4000,7 +4000,7 @@ var_dump($select_options);*/
foreach ($attributes as $key => $value) foreach ($attributes as $key => $value)
{ {
if ($value === true) $value = $key; if ($value === true) $value = $key;
if (!empty($value) || is_numeric($value)) if (!empty($value) || is_numeric($value) || $key === "value")
{ {
$stringifiedAttributes[] = $key . "='" . htmlspecialchars($value, ENT_QUOTES) . "'"; $stringifiedAttributes[] = $key . "='" . htmlspecialchars($value, ENT_QUOTES) . "'";
} }

File diff suppressed because one or more lines are too long