aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/scripts/behaviour.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts/behaviour.js')
-rw-r--r--lib/scripts/behaviour.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js
index 009081f80..608a29de0 100644
--- a/lib/scripts/behaviour.js
+++ b/lib/scripts/behaviour.js
@@ -215,25 +215,26 @@ var dw_behaviour = {
* avoids overeager security bans (see #3363)
*/
securityCheck: function () {
- var $checkA = jQuery('#security__check');
- if (!$checkA.length) return;
- if (sessionStorage.getItem('security-check')) {
+ var $checkDiv = jQuery('#security__check');
+ if (!$checkDiv.length) return;
+ if (sessionStorage.getItem('dw-security-check:' + DOKU_BASE)) {
// check was already executed successfully
- $checkA.remove();
+ $checkDiv.remove();
return;
}
- var img = new Image(347, 63);
+ var img = new Image();
img.onerror = function () {
// successful check will not be repeated during session
- $checkA.remove();
- sessionStorage.setItem('security-check', true);
+ $checkDiv.remove();
+ sessionStorage.setItem('dw-security-check:' + DOKU_BASE, true);
}
img.onload = function () {
- // check failed, display the image
- $checkA.html(img);
+ // check failed, display a warning message
+ $checkDiv.html(LANG.data_insecure);
+ $checkDiv.addClass('error');
}
- img.src = $checkA.data('src');
+ img.src = $checkDiv.data('src');
}
};