[BUGFIX] RSA encryption: Stop submit handling if requested 45/53845/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 31 Aug 2017 13:41:56 +0000 (15:41 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 6 Oct 2017 10:47:21 +0000 (12:47 +0200)
If the submit event of a form using RSA encryption has `cancelBubble` set
to true (e.g. by jQuery's stopPropagation()), any processing is stopped
to prevent submitting the form.

Resolves: #82259
Releases: master, 8.7
Change-Id: Idb357dd2043cccb899ad7fa3fa325f7d3c003e40
Reviewed-on: https://review.typo3.org/53845
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rsaauth/Resources/Public/JavaScript/RsaEncryption.js

index 0ef3651..05024e8 100644 (file)
                 * Fetches a new public key by Ajax and encrypts the password for transmission
                 */
                this.handleFormSubmitRequest = function(event) {
+                       if (event.cancelBubble) {
+                               return;
+                       }
+
                        var rsaEncryption = this.rsaEncryption || event.srcElement.rsaEncryption;
                        if (!rsaEncryption) {
                                return;