1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-26 15:54:34 +02:00

Store current Adminer version server-side to avoid excessive requests

This commit is contained in:
Jakub Vrana
2018-01-24 14:15:55 +01:00
parent f4662d5e27
commit 6c96b060e7
4 changed files with 21 additions and 2 deletions

View File

@@ -95,8 +95,10 @@ function cookie(assign, days) {
/** Verify current Adminer version
* @param string
* @param string own URL base
* @param string
*/
function verifyVersion(current) {
function verifyVersion(current, url, token) {
cookie('adminer_version=0', 1);
var iframe = document.createElement('iframe');
iframe.src = 'https://www.adminer.org/version/?current=' + current;
@@ -112,6 +114,8 @@ function verifyVersion(current) {
var match = /version=(.+)/.exec(event.data);
if (match) {
cookie('adminer_version=' + match[1], 1);
ajax(url + 'script=version', function () {
}, 'version=' + match[1] + '&token=' + token);
}
}
}, false);