@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use SilverStripe\Control\Cookie; |
6 | 6 | use SilverStripe\HybridSessions\Crypto\CryptoHandler; |
7 | -use SilverStripe\Core\Config\Config; |
|
8 | 7 | use SilverStripe\Core\Injector\Injector; |
9 | 8 | |
10 | 9 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | // Verify expiration |
113 | 113 | if ($cookieData) { |
114 | - $expiry = (int)substr($cookieData, 0, 10); |
|
114 | + $expiry = (int) substr($cookieData, 0, 10); |
|
115 | 115 | $data = substr($cookieData, 10); |
116 | 116 | |
117 | 117 | if ($expiry > $this->getNow()) { |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | |
149 | 149 | // Restore the known good cookie value |
150 | 150 | $this->currentCookieData = $this->crypto->encrypt( |
151 | - sprintf('%010u', $expiry) . $session_data |
|
151 | + sprintf('%010u', $expiry).$session_data |
|
152 | 152 | ); |
153 | 153 | |
154 | 154 | // Respect auto-expire on browser close for the session cookie (in case the cookie lifetime is zero) |
155 | - $cookieLifetime = min((int)$params['lifetime'], $lifetime); |
|
155 | + $cookieLifetime = min((int) $params['lifetime'], $lifetime); |
|
156 | 156 | |
157 | 157 | Cookie::set( |
158 | 158 | $this->cookie, |
@@ -45,8 +45,8 @@ |
||
45 | 45 | protected function getLifetime() |
46 | 46 | { |
47 | 47 | $params = session_get_cookie_params(); |
48 | - $cookieLifetime = (int)$params['lifetime']; |
|
49 | - $gcLifetime = (int)ini_get('session.gc_maxlifetime'); |
|
48 | + $cookieLifetime = (int) $params['lifetime']; |
|
49 | + $gcLifetime = (int) ini_get('session.gc_maxlifetime'); |
|
50 | 50 | |
51 | 51 | return $cookieLifetime ? min($cookieLifetime, $gcLifetime) : $gcLifetime; |
52 | 52 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $ivlen = openssl_cipher_iv_length($cipher); |
85 | 85 | $iv = substr($c, 0, $ivlen); |
86 | 86 | $hmac = substr($c, $ivlen, $sha2len = 32); |
87 | - $ciphertext_raw = substr($c, $ivlen+$sha2len); |
|
87 | + $ciphertext_raw = substr($c, $ivlen + $sha2len); |
|
88 | 88 | $cleartext = openssl_decrypt($ciphertext_raw, $cipher, $this->saltedKey, $options = OPENSSL_RAW_DATA, $iv); |
89 | 89 | $calcmac = hash_hmac('sha256', $ciphertext_raw, $this->saltedKey, $as_binary = true); |
90 | 90 |