From fcf08ed687c8256914073f2fda68e96b462e63af Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Mon, 2 Dec 2024 10:02:57 +0100 Subject: [PATCH] Use `JSON.parse()` instead of `eval()`. --- .../templates/radioButtonOptionType.tpl | 2 +- .../templates/selectOptionType.tpl | 2 +- .../templates/shared_booleanOptionType.tpl | 4 +- .../shared_booleanSearchableOptionType.tpl | 4 +- .../templates/shared_checkboxesOptionType.tpl | 2 +- ...shared_radioButtonSearchableOptionType.tpl | 2 +- .../Core/Component/Option/Enable.ts | 45 ++++++++++++++----- .../acp/templates/radioButtonOptionType.tpl | 2 +- .../files/acp/templates/selectOptionType.tpl | 4 +- .../acp/templates/userEmailAddressExport.tpl | 4 +- .../templates/userGroupBooleanOptionType.tpl | 6 +-- .../Core/Component/Option/Enable.js | 40 ++++++++++++----- .../files/lib/data/option/Option.class.php | 4 +- .../option/CaptchaSelectOptionType.class.php | 4 +- .../system/option/SelectOptionType.class.php | 4 +- 15 files changed, 83 insertions(+), 46 deletions(-) diff --git a/com.woltlab.wcf/templates/radioButtonOptionType.tpl b/com.woltlab.wcf/templates/radioButtonOptionType.tpl index 87e2e637ae..21a53727b6 100644 --- a/com.woltlab.wcf/templates/radioButtonOptionType.tpl +++ b/com.woltlab.wcf/templates/radioButtonOptionType.tpl @@ -1,3 +1,3 @@ {foreach name=radioButtons from=$selectOptions key=key item=selectOption} - + {/foreach} diff --git a/com.woltlab.wcf/templates/selectOptionType.tpl b/com.woltlab.wcf/templates/selectOptionType.tpl index 9d325fa1b1..7529516b61 100644 --- a/com.woltlab.wcf/templates/selectOptionType.tpl +++ b/com.woltlab.wcf/templates/selectOptionType.tpl @@ -1,4 +1,4 @@ -required} required{/if}{if $disableOptions || $enableOptions} class="jsEnablesOptions" data-is-boolean="true" data-disable-options="[ {$disableOptions}]" data-enable-options="[ {$enableOptions}]"{/if}> {if !$allowEmptyValue|empty}{/if} {foreach from=$selectOptions key=key item=selectOption} diff --git a/com.woltlab.wcf/templates/shared_booleanOptionType.tpl b/com.woltlab.wcf/templates/shared_booleanOptionType.tpl index 54a9581aa8..21818bfead 100644 --- a/com.woltlab.wcf/templates/shared_booleanOptionType.tpl +++ b/com.woltlab.wcf/templates/shared_booleanOptionType.tpl @@ -1,10 +1,10 @@
  1. - +
  2. - +
diff --git a/com.woltlab.wcf/templates/shared_booleanSearchableOptionType.tpl b/com.woltlab.wcf/templates/shared_booleanSearchableOptionType.tpl index 6e76182fae..444649675f 100644 --- a/com.woltlab.wcf/templates/shared_booleanSearchableOptionType.tpl +++ b/com.woltlab.wcf/templates/shared_booleanSearchableOptionType.tpl @@ -1,11 +1,11 @@
  1. - +
  2. - +
diff --git a/com.woltlab.wcf/templates/shared_checkboxesOptionType.tpl b/com.woltlab.wcf/templates/shared_checkboxesOptionType.tpl index cc90e693d0..57dcf08e45 100644 --- a/com.woltlab.wcf/templates/shared_checkboxesOptionType.tpl +++ b/com.woltlab.wcf/templates/shared_checkboxesOptionType.tpl @@ -1,3 +1,3 @@ {foreach from=$selectOptions key=key item=selectOption} - + {/foreach} diff --git a/com.woltlab.wcf/templates/shared_radioButtonSearchableOptionType.tpl b/com.woltlab.wcf/templates/shared_radioButtonSearchableOptionType.tpl index 893447a902..699751c0e2 100644 --- a/com.woltlab.wcf/templates/shared_radioButtonSearchableOptionType.tpl +++ b/com.woltlab.wcf/templates/shared_radioButtonSearchableOptionType.tpl @@ -1,6 +1,6 @@ {foreach from=$selectOptions key=key item=selectOption} - + {/foreach}