Merge pull request #11756 from nextcloud/ignore-session-lifetime-if-it-can-not-be-converted-to-a-number

Ignore "session_lifetime" if it can not be converted to a number
This commit is contained in:
Roeland Jago Douma 2018-10-11 11:42:41 +02:00 committed by GitHub
commit fa15c5e636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1383,10 +1383,12 @@ function initCore() {
*/ */
function initSessionHeartBeat() { function initSessionHeartBeat() {
// interval in seconds // interval in seconds
var interval = 900; var interval = NaN;
if (oc_config.session_lifetime) { if (oc_config.session_lifetime) {
interval = Math.floor(oc_config.session_lifetime / 2); interval = Math.floor(oc_config.session_lifetime / 2);
} }
interval = isNaN(interval)? 900: interval;
// minimum one minute // minimum one minute
interval = Math.max(60, interval); interval = Math.max(60, interval);
// max interval in seconds set to 24 hours // max interval in seconds set to 24 hours