From: Alexander Ebert Date: Thu, 23 Feb 2017 12:24:00 +0000 (+0100) Subject: Added check for insufficient PHP version during upgrade X-Git-Tag: 3.0.3~28 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=81597b0b673a53f23ddef7d02ae8e1a713786310;p=GitHub%2FWoltLab%2FWCF.git Added check for insufficient PHP version during upgrade --- diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_pre_sql.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_pre_sql.php index 10af0fc769..89beb3bda8 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_pre_sql.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_pre_sql.php @@ -1,6 +1,19 @@ = 0)) { + $message = "Your PHP version '{$phpVersion}' is insufficient for installation of this software. PHP version {$neededPhpVersion} or greater is required."; + if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { + $message = "Ihre PHP Version '{$phpVersion}' ist unzureichend für die Installation dieser Software. PHP Version {$neededPhpVersion} oder höher wird benötigt."; + } + + throw new SystemException($message); +} + // change encoding of wcf1_acp_session; necessary for foreign key in wcf1_acp_session_virtual $sql = "ALTER TABLE wcf".WCF_N."_acp_session CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; $statement = WCF::getDB()->prepareStatement($sql); @@ -24,7 +37,8 @@ $statement->execute(); // create virtual session for current user $sql = "INSERT INTO wcf".WCF_N."_acp_session_virtual (sessionID, ipAddress, userAgent, lastActivityTime) SELECT sessionID, ipAddress, userAgent, lastActivityTime FROM wcf".WCF_N."_acp_session WHERE sessionID = ?"; $statement = \wcf\system\WCF::getDB()->prepareStatement($sql); -$statement->execute([WCF::getSession()->sessionID]); +// WARNING: do not use [...] array syntax here, as this file is also used to check for PHP 5.5+ +$statement->execute(array(WCF::getSession()->sessionID)); // create session cookie @header('Set-Cookie: '.rawurlencode(COOKIE_PREFIX . 'cookieHash_acp').'='.rawurlencode(WCF::getSession()->sessionID).'; path=/'.(\wcf\system\request\RouteHandler::secureConnection() ? '; secure' : '').'; HttpOnly', false);