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

[stable13] Ignore "session_lifetime" if it can not be converted to a number
This commit is contained in:
Morris Jobke 2018-10-11 13:25:38 +02:00 committed by GitHub
commit 329c2108b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1356,10 +1356,12 @@ function initCore() {
// max interval in seconds set to 24 hours // max interval in seconds set to 24 hours
var maxInterval = 24 * 3600; var maxInterval = 24 * 3600;
// 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
if (interval < 60) { if (interval < 60) {
interval = 60; interval = 60;