Improve variable naming in update_com.woltlab.wcf_5.4_session_1_cookies.php
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 26 Nov 2020 11:35:21 +0000 (12:35 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 26 Nov 2020 11:35:21 +0000 (12:35 +0100)
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_1_cookies.php

index 7bd8faf70e4c4cf17484b68bfb7340a48e4efb4f..db926ee46116595fff70575a33527eb1d989fac8 100644 (file)
@@ -18,25 +18,25 @@ use wcf\util\CryptoUtil;
 use wcf\util\HeaderUtil;
 
 // 1) Check whether the cookies are already in place.
-$sessionIdOkay = false;
+$hasValidSessionCookie = false;
 if (!empty($_COOKIE[COOKIE_PREFIX."acp_session"])) {
        $cookieValue = CryptoUtil::getValueFromSignedString($_COOKIE[COOKIE_PREFIX."acp_session"]);
        if ($cookieValue) {
                $sessionID = \bin2hex($cookieValue);
                if ($sessionID === WCF::getSession()->sessionID) {
-                       $sessionIdOkay = true;
+                       $hasValidSessionCookie = true;
                }
        }
 }
 
-$xsrfTokenOkay = false;
+$hasValidXsrfToken = false;
 if (!empty($_COOKIE['XSRF-TOKEN'])) {
        if (CryptoUtil::validateSignedString($_COOKIE['XSRF-TOKEN'])) {
-               $xsrfTokenOkay = true;
+               $hasValidXsrfToken = true;
        }
 }
 
-if ($sessionIdOkay && $xsrfTokenOkay) {
+if ($hasValidSessionCookie && $hasValidXsrfToken) {
        // The process may continue;
        return;
 }