From 85f179ea770fc56c8ba5197b09d87edcc87413b9 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 28 Feb 2014 18:29:46 +0100 Subject: [PATCH] Fixed update script --- .../files/acp/update_com.woltlab.wcf_2.0.3.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_2.0.3.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_2.0.3.php index 937d786032..144f9fd5ed 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_2.0.3.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_2.0.3.php @@ -9,12 +9,18 @@ use wcf\system\WCF; * @category Community Framework */ // enforce new limits for session timeout (prevents misconfiguration) -$sql = "UPDATE wcf".WCF_N."_option - SET optionValue = MIN(MAX(optionValue, ?), ?) +$sql = "SELECT optionID, optionValue + FROM wcf".WCF_N."_option WHERE optionName = ?"; $statement = WCF::getDB()->prepareStatement($sql); +$statement->execute(array('session_timeout')); +$row = $statement->fetchArray(); + +$sql = "UPDATE wcf".WCF_N."_option + SET optionValue = ? + WHERE optionID = ?"; +$statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array( - 600, - 86400, - 'session_timeout' + min(max(600, $row['optionValue']), 86400), + $row['optionID'] )); -- 2.20.1