Skip to content

Commit f30fa99

Browse files
committed
webform captcha: UCBoulder/oit_dingo#1093
- Update label for new captchas - Add xss check even though I'm sure it's fine
1 parent 1c89c8d commit f30fa99

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

oit.module

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ function oit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
110110

111111
if ($captcha_config) {
112112
$button_text = t('Add captcha to form');
113-
$form['#prefix'] = "<ul class='no-list-style'><li class='red'><a href='/admin/config/people/captcha/captcha-points/add?destination=node/$node_id&webform_id=$node_id' class='button icon'>⬇️ $button_text</a></li></ul>";
113+
$form['#prefix'] = Xss::filter("<ul class='no-list-style'><li class='red'><a href='/admin/config/people/captcha/captcha-points/add?destination=node/$node_id&webform_id=$node_id' class='button icon'>⬇️ $button_text</a></li></ul>");
114114
}
115115
else {
116116
$button_text = t('Remove captcha from form');
117-
$form['#prefix'] = "<ul class='no-list-style'><li class='red'><a href='/admin/config/people/captcha/captcha-points/webform_add_$node_id/delete?destination=node/$node_id' class='button icon'>🔥 $button_text</a></li></ul>";
117+
$form['#prefix'] = Xss::filter("<ul class='no-list-style'><li class='red'><a href='/admin/config/people/captcha/captcha-points/webform_add_$node_id/delete?destination=node/$node_id' class='button icon'>🔥 $button_text</a></li></ul>");
118118
}
119119

120120
}
@@ -133,7 +133,7 @@ function oit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
133133
return;
134134
}
135135

136-
$form['label']['#default_value'] = 'webform_submission_oit_project_accessibility_review_node_' . $webform_id . '_add_form';
136+
$form['label']['#default_value'] = 'webform_' . $webform_id;
137137
$form['formId']['#default_value'] = 'webform_add_' . $webform_id;
138138
}
139139

0 commit comments

Comments
 (0)