1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01: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
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637
2 changed files with 5 additions and 5 deletions

View File

@ -4000,7 +4000,7 @@ var_dump($select_options);*/
foreach ($attributes as $key => $value)
{
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) . "'";
}

File diff suppressed because one or more lines are too long