From e79bfbdbeb949dfa0347b005a797b2bd322801cd Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Mon, 15 Dec 2014 16:12:33 +0530 Subject: [PATCH] bug #4630 AJAX request infinite loop Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + js/functions.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83cbc1df4d..af41cb2bd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ phpMyAdmin - ChangeLog - bug The "Recently used tables" setting should be with Nav panel - bug #4647 Can't disable Favorites - bug #4646 Version Check Broken +- bug #4630 AJAX request infinite loop 4.3.2.0 (2014-12-12) - bug #4628 PHP error while exporting schema as PDF diff --git a/js/functions.js b/js/functions.js index 144b06ed1d..2de4521393 100644 --- a/js/functions.js +++ b/js/functions.js @@ -705,7 +705,11 @@ AJAX.registerOnload('functions.js', function () { clearInterval(updateInterval); if (data.success) { if (PMA_commonParams.get('LoginCookieValidity')-_idleSecondsCounter > 5) { - updateInterval = window.setInterval(UpdateIdleTime, (PMA_commonParams.get('LoginCookieValidity')-_idleSecondsCounter-5)*1000); + var interval = (PMA_commonParams.get('LoginCookieValidity') - _idleSecondsCounter - 5) * 1000; + if (interval > Math.pow(2, 31) - 1) { // max value for setInterval() function + interval = Math.pow(2, 31) - 1; + } + updateInterval = window.setInterval(UpdateIdleTime, interval); } else { updateInterval = window.setInterval(UpdateIdleTime, 2000); } @@ -718,7 +722,11 @@ AJAX.registerOnload('functions.js', function () { } if (PMA_commonParams.get('logged_in')) { IncInterval = window.setInterval(SetIdleTime, 1000); - updateInterval = window.setInterval(UpdateIdleTime, (PMA_commonParams.get('LoginCookieValidity')-5)*1000); + var interval = (PMA_commonParams.get('LoginCookieValidity') - 5) * 1000; + if (interval > Math.pow(2, 31) - 1) { // max value for setInterval() function + interval = Math.pow(2, 31) - 1; + } + updateInterval = window.setInterval(UpdateIdleTime, interval); } }); /**