Skip to content
Snippets Groups Projects
Commit a8ca5f0e authored by Mathias Brodala's avatar Mathias Brodala Committed by Stefan Neufeind
Browse files

[TASK] Use DOM API for field access in RSA encryption

DOM Level 2 provides collections for forms and form elements,
thus make use of them.

Resolves: #68765
Releases: master
Change-Id: I795b2c3348d7a39fdbe277df4c6661e3427c5e1f
Reviewed-on: http://review.typo3.org/42281


Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent 131bd4de
Branches
Tags
No related merge requests found
...@@ -111,9 +111,8 @@ ...@@ -111,9 +111,8 @@
if (form.submit.call) { if (form.submit.call) {
form.submit.call(rsaEncryption.form); form.submit.call(rsaEncryption.form);
} else { } else {
var fields = rsaEncryption.form.getElementsByTagName('*'); for (var j = rsaEncryption.form.elements.length; j--;) {
for (var j = fields.length; j--;) { var submitField = rsaEncryption.form.elements[j];
var submitField = fields[j];
if (submitField.nodeName.toLowerCase() === 'input' && submitField.type === "submit") { if (submitField.nodeName.toLowerCase() === 'input' && submitField.type === "submit") {
submitField.click(); submitField.click();
} }
...@@ -132,12 +131,10 @@ ...@@ -132,12 +131,10 @@
documentReadyFunctionCalled = true; documentReadyFunctionCalled = true;
rng_seed_time(); rng_seed_time();
var forms = document.getElementsByTagName('form'); for (var i = document.forms.length; i--;) {
for (var i = forms.length; i--;) { var form = document.forms[i];
var form = forms[i]; for (var j = form.elements.length; j--;) {
var fields = form.getElementsByTagName('*'); var field = form.elements[j];
for (var j = fields.length; j--;) {
var field = fields[j];
if (field.nodeName.toLowerCase() === 'input') { if (field.nodeName.toLowerCase() === 'input') {
var dataAttribute = field.getAttribute('data-rsa-encryption'); var dataAttribute = field.getAttribute('data-rsa-encryption');
if (dataAttribute || dataAttribute === '' && field.outerHTML.match(/ data-rsa-encryption=""/)) { if (dataAttribute || dataAttribute === '' && field.outerHTML.match(/ data-rsa-encryption=""/)) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment