@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function open($save_path, $name) |
82 | 82 | { |
83 | - $this->path = $this->config[ 'filePath' ]; |
|
83 | + $this->path = $this->config['filePath']; |
|
84 | 84 | |
85 | 85 | if ($this->isSupported() === false) { |
86 | 86 | if ($this->logger instanceof LoggerInterface) { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | $this->filePath = $this->path |
94 | 94 | . $name . '-' // we'll use the session cookie name as a prefix to avoid collisions |
95 | - . ($this->config[ 'match' ]->ip ? md5($_SERVER[ 'REMOTE_ADDR' ]) . '-' : ''); |
|
95 | + . ($this->config['match']->ip ? md5($_SERVER['REMOTE_ADDR']) . '-' : ''); |
|
96 | 96 | |
97 | 97 | return $this->success; |
98 | 98 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | while (($file = readdir($directory)) !== false) { |
213 | 213 | // If the filename doesn't match this pattern, it's either not a session file or is not ours |
214 | - if ( ! preg_match('/[' . $this->config[ 'name' ] . '-]+[0-9-a-f]+/', $file) |
|
214 | + if ( ! preg_match('/[' . $this->config['name'] . '-]+[0-9-a-f]+/', $file) |
|
215 | 215 | || ! is_file($this->path . '/' . $file) |
216 | 216 | || ($mtime = filemtime($this->path . '/' . $file)) === false |
217 | 217 | || $mtime > $ts |
@@ -88,7 +88,7 @@ |
||
88 | 88 | $this->logger->error('SESSION_E_PLATFORM_UNSUPPORTED', ['Redis']); |
89 | 89 | } |
90 | 90 | |
91 | - z |
|
91 | + z |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | try { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function setLogger(LoggerInterface $logger) |
114 | 114 | { |
115 | - $this->logger =& $logger; |
|
115 | + $this->logger = & $logger; |
|
116 | 116 | |
117 | 117 | // Load Session Language |
118 | 118 | language()->loadFile('session'); |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | session_set_save_handler($this->handler, true); |
157 | 157 | |
158 | 158 | // Sanitize the cookie, because apparently PHP doesn't do that for userspace handlers |
159 | - if (isset($_COOKIE[ $this->config[ 'name' ] ]) && ( |
|
160 | - ! is_string($_COOKIE[ $this->config[ 'name' ] ]) || ! preg_match('#\A' . $this->sidRegexp . '\z#', |
|
161 | - $_COOKIE[ $this->config[ 'name' ] ]) |
|
159 | + if (isset($_COOKIE[$this->config['name']]) && ( |
|
160 | + ! is_string($_COOKIE[$this->config['name']]) || ! preg_match('#\A' . $this->sidRegexp . '\z#', |
|
161 | + $_COOKIE[$this->config['name']]) |
|
162 | 162 | ) |
163 | 163 | ) { |
164 | - unset($_COOKIE[ $this->config[ 'name' ] ]); |
|
164 | + unset($_COOKIE[$this->config['name']]); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -176,37 +176,37 @@ discard block |
||
176 | 176 | $this->initializeVariables(); |
177 | 177 | |
178 | 178 | // Sanitize the cookie, because apparently PHP doesn't do that for userspace handlers |
179 | - if (isset($_COOKIE[ $this->config[ 'name' ] ]) && ( |
|
180 | - ! is_string($this->config[ 'name' ]) || |
|
181 | - ! preg_match('#\A' . $this->sidRegexp . '\z#', $_COOKIE[ $this->config[ 'name' ] ] |
|
179 | + if (isset($_COOKIE[$this->config['name']]) && ( |
|
180 | + ! is_string($this->config['name']) || |
|
181 | + ! preg_match('#\A' . $this->sidRegexp . '\z#', $_COOKIE[$this->config['name']] |
|
182 | 182 | ) |
183 | 183 | ) |
184 | 184 | ) { |
185 | - unset($_COOKIE[ $this->config[ 'name' ] ]); |
|
185 | + unset($_COOKIE[$this->config['name']]); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | // Is session ID auto-regeneration configured? (ignoring ajax requests) |
189 | - if ((empty($_SERVER[ 'HTTP_X_REQUESTED_WITH' ]) || |
|
190 | - strtolower($_SERVER[ 'HTTP_X_REQUESTED_WITH' ]) !== 'xmlhttprequest') && |
|
191 | - ($regenerateTime = $this->config[ 'regenerate' ]->lifetime) > 0 |
|
189 | + if ((empty($_SERVER['HTTP_X_REQUESTED_WITH']) || |
|
190 | + strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') && |
|
191 | + ($regenerateTime = $this->config['regenerate']->lifetime) > 0 |
|
192 | 192 | ) { |
193 | - if ( ! isset($_SESSION[ 'last_regenerate' ])) { |
|
194 | - $_SESSION[ 'last_regenerate' ] = time(); |
|
195 | - } elseif ($_SESSION[ 'last_regenerate' ] < (time() - $regenerateTime)) { |
|
193 | + if ( ! isset($_SESSION['last_regenerate'])) { |
|
194 | + $_SESSION['last_regenerate'] = time(); |
|
195 | + } elseif ($_SESSION['last_regenerate'] < (time() - $regenerateTime)) { |
|
196 | 196 | $this->regenerate(); |
197 | 197 | } |
198 | 198 | } |
199 | 199 | // Another work-around ... PHP doesn't seem to send the session cookie |
200 | 200 | // unless it is being currently created or regenerated |
201 | - elseif (isset($_COOKIE[ $this->config[ 'name' ] ]) && $_COOKIE[ $this->config[ 'name' ] ] === session_id() |
|
201 | + elseif (isset($_COOKIE[$this->config['name']]) && $_COOKIE[$this->config['name']] === session_id() |
|
202 | 202 | ) { |
203 | 203 | setcookie( |
204 | - $this->config[ 'name' ], |
|
204 | + $this->config['name'], |
|
205 | 205 | session_id(), |
206 | - (empty($this->config[ 'lifetime' ]) ? 0 : time() + $this->config[ 'lifetime' ]), |
|
207 | - $this->config[ 'cookie' ]->path, |
|
208 | - '.' . ltrim($this->config[ 'cookie' ]->domain, '.'), |
|
209 | - $this->config[ 'cookie' ]->secure, |
|
206 | + (empty($this->config['lifetime']) ? 0 : time() + $this->config['lifetime']), |
|
207 | + $this->config['cookie']->path, |
|
208 | + '.' . ltrim($this->config['cookie']->domain, '.'), |
|
209 | + $this->config['cookie']->secure, |
|
210 | 210 | true |
211 | 211 | ); |
212 | 212 | } |
@@ -227,23 +227,23 @@ discard block |
||
227 | 227 | */ |
228 | 228 | private function setConfiguration() |
229 | 229 | { |
230 | - ini_set('session.name', $this->config[ 'name' ]); |
|
230 | + ini_set('session.name', $this->config['name']); |
|
231 | 231 | |
232 | - if (empty($this->config[ 'lifetime' ])) { |
|
233 | - $this->config[ 'lifetime' ] = (int)ini_get('session.gc_maxlifetime'); |
|
232 | + if (empty($this->config['lifetime'])) { |
|
233 | + $this->config['lifetime'] = (int)ini_get('session.gc_maxlifetime'); |
|
234 | 234 | } else { |
235 | - ini_set('session.gc_maxlifetime', (int)$this->config[ 'lifetime' ]); |
|
235 | + ini_set('session.gc_maxlifetime', (int)$this->config['lifetime']); |
|
236 | 236 | } |
237 | 237 | |
238 | - if (empty($this->config[ 'cookie' ]->domain)) { |
|
239 | - $this->config[ 'cookie' ]->domain = (isset($_SERVER[ 'HTTP_HOST' ]) ? $_SERVER[ 'HTTP_HOST' ] |
|
240 | - : (isset($_SERVER[ 'SERVER_NAME' ]) ? $_SERVER[ 'SERVER_NAME' ] : null)); |
|
238 | + if (empty($this->config['cookie']->domain)) { |
|
239 | + $this->config['cookie']->domain = (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] |
|
240 | + : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null)); |
|
241 | 241 | } |
242 | 242 | |
243 | - $this->config[ 'cookie' ]->domain = ltrim($this->config[ 'cookie' ]->domain, '.'); |
|
243 | + $this->config['cookie']->domain = ltrim($this->config['cookie']->domain, '.'); |
|
244 | 244 | |
245 | - ini_set('session.cookie_domain', '.' . $this->config[ 'cookie' ]->domain); |
|
246 | - ini_set('session.cookie_path', $this->config[ 'cookie' ]->path); |
|
245 | + ini_set('session.cookie_domain', '.' . $this->config['cookie']->domain); |
|
246 | + ini_set('session.cookie_path', $this->config['cookie']->path); |
|
247 | 247 | |
248 | 248 | // Security is king |
249 | 249 | ini_set('session.cookie_lifetime', 0); |
@@ -330,25 +330,25 @@ discard block |
||
330 | 330 | */ |
331 | 331 | private function initializeVariables() |
332 | 332 | { |
333 | - if (empty($_SESSION[ 'system_variables' ])) { |
|
333 | + if (empty($_SESSION['system_variables'])) { |
|
334 | 334 | return; |
335 | 335 | } |
336 | 336 | |
337 | 337 | $currentTime = time(); |
338 | 338 | |
339 | - foreach ($_SESSION[ 'system_variables' ] as $key => &$value) { |
|
339 | + foreach ($_SESSION['system_variables'] as $key => &$value) { |
|
340 | 340 | if ($value === 'new') { |
341 | - $_SESSION[ 'system_variables' ][ $key ] = 'old'; |
|
341 | + $_SESSION['system_variables'][$key] = 'old'; |
|
342 | 342 | } |
343 | 343 | // Hacky, but 'old' will (implicitly) always be less than time() ;) |
344 | 344 | // DO NOT move this above the 'new' check! |
345 | 345 | elseif ($value < $currentTime) { |
346 | - unset($_SESSION[ $key ], $_SESSION[ 'system_variables' ][ $key ]); |
|
346 | + unset($_SESSION[$key], $_SESSION['system_variables'][$key]); |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | - if (empty($_SESSION[ 'system_variables' ])) { |
|
351 | - unset($_SESSION[ 'system_variables' ]); |
|
350 | + if (empty($_SESSION['system_variables'])) { |
|
351 | + unset($_SESSION['system_variables']); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function regenerate() |
363 | 363 | { |
364 | - $_SESSION[ 'last_regenerate' ] = time(); |
|
365 | - session_regenerate_id($this->config[ 'regenerate' ]->destroy); |
|
364 | + $_SESSION['last_regenerate'] = time(); |
|
365 | + session_regenerate_id($this->config['regenerate']->destroy); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | //-------------------------------------------------------------------- |
@@ -396,12 +396,12 @@ discard block |
||
396 | 396 | public function stop() |
397 | 397 | { |
398 | 398 | setcookie( |
399 | - $this->config[ 'name' ], |
|
399 | + $this->config['name'], |
|
400 | 400 | session_id(), |
401 | 401 | 1, |
402 | - $this->config[ 'cookie' ]->path, |
|
403 | - '.' . ltrim($this->config[ 'cookie' ]->domain, '.'), |
|
404 | - $this->config[ 'cookie' ]->secure, |
|
402 | + $this->config['cookie']->path, |
|
403 | + '.' . ltrim($this->config['cookie']->domain, '.'), |
|
404 | + $this->config['cookie']->secure, |
|
405 | 405 | true |
406 | 406 | ); |
407 | 407 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | */ |
461 | 461 | public function offsetExists($offset) |
462 | 462 | { |
463 | - return (bool)isset($_SESSION[ $offset ]); |
|
463 | + return (bool)isset($_SESSION[$offset]); |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | // ------------------------------------------------------------------------ |
@@ -495,14 +495,14 @@ discard block |
||
495 | 495 | public function &__get($offset) |
496 | 496 | { |
497 | 497 | if ($offset === 'id') { |
498 | - $_SESSION[ 'id' ] = session_id(); |
|
498 | + $_SESSION['id'] = session_id(); |
|
499 | 499 | } |
500 | 500 | |
501 | - if ( ! isset($_SESSION[ $offset ])) { |
|
502 | - $_SESSION[ $offset ] = null; |
|
501 | + if ( ! isset($_SESSION[$offset])) { |
|
502 | + $_SESSION[$offset] = null; |
|
503 | 503 | } |
504 | 504 | |
505 | - return $_SESSION[ $offset ]; |
|
505 | + return $_SESSION[$offset]; |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | // ------------------------------------------------------------------------ |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | public function offsetSet($offset, $value) |
544 | 544 | { |
545 | - $_SESSION[ $offset ] =& $value; |
|
545 | + $_SESSION[$offset] = & $value; |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | // ------------------------------------------------------------------------ |
@@ -580,8 +580,8 @@ discard block |
||
580 | 580 | */ |
581 | 581 | public function offsetUnset($offset) |
582 | 582 | { |
583 | - if (isset($_SESSION[ $offset ])) { |
|
584 | - unset($_SESSION[ $offset ]); |
|
583 | + if (isset($_SESSION[$offset])) { |
|
584 | + unset($_SESSION[$offset]); |
|
585 | 585 | } |
586 | 586 | } |
587 | 587 | |
@@ -644,13 +644,13 @@ discard block |
||
644 | 644 | { |
645 | 645 | if (is_array($offset)) { |
646 | 646 | foreach ($offset as $key => &$value) { |
647 | - $_SESSION[ $key ] = $value; |
|
647 | + $_SESSION[$key] = $value; |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | return; |
651 | 651 | } |
652 | 652 | |
653 | - $_SESSION[ $offset ] =& $value; |
|
653 | + $_SESSION[$offset] = & $value; |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | //-------------------------------------------------------------------- |
@@ -668,26 +668,26 @@ discard block |
||
668 | 668 | { |
669 | 669 | if (is_array($offset)) { |
670 | 670 | for ($i = 0, $c = count($offset); $i < $c; $i++) { |
671 | - if ( ! isset($_SESSION[ $offset[ $i ] ])) { |
|
671 | + if ( ! isset($_SESSION[$offset[$i]])) { |
|
672 | 672 | return false; |
673 | 673 | } |
674 | 674 | } |
675 | 675 | |
676 | 676 | $new = array_fill_keys($offset, 'new'); |
677 | 677 | |
678 | - $_SESSION[ 'system_variables' ] = isset($_SESSION[ 'system_variables' ]) ? array_merge( |
|
679 | - $_SESSION[ 'system_variables' ], |
|
678 | + $_SESSION['system_variables'] = isset($_SESSION['system_variables']) ? array_merge( |
|
679 | + $_SESSION['system_variables'], |
|
680 | 680 | $new |
681 | 681 | ) : $new; |
682 | 682 | |
683 | 683 | return true; |
684 | 684 | } |
685 | 685 | |
686 | - if ( ! isset($_SESSION[ $offset ])) { |
|
686 | + if ( ! isset($_SESSION[$offset])) { |
|
687 | 687 | return false; |
688 | 688 | } |
689 | 689 | |
690 | - $_SESSION[ 'system_variables' ][ $offset ] = 'new'; |
|
690 | + $_SESSION['system_variables'][$offset] = 'new'; |
|
691 | 691 | |
692 | 692 | return true; |
693 | 693 | } |
@@ -725,10 +725,10 @@ discard block |
||
725 | 725 | public function offsetGet($offset) |
726 | 726 | { |
727 | 727 | if ($offset === 'id') { |
728 | - $_SESSION[ 'id' ] = session_id(); |
|
728 | + $_SESSION['id'] = session_id(); |
|
729 | 729 | } |
730 | 730 | |
731 | - return (isset($_SESSION[ $offset ])) ? $_SESSION[ $offset ] : false; |
|
731 | + return (isset($_SESSION[$offset])) ? $_SESSION[$offset] : false; |
|
732 | 732 | } |
733 | 733 | |
734 | 734 | //-------------------------------------------------------------------- |
@@ -746,15 +746,15 @@ discard block |
||
746 | 746 | public function getFlash($offset = null) |
747 | 747 | { |
748 | 748 | if (isset($offset)) { |
749 | - return (isset($_SESSION[ 'system_variables' ], $_SESSION[ 'system_variables' ][ $offset ], $_SESSION[ $offset ]) && |
|
750 | - ! is_int($_SESSION[ 'system_variables' ][ $offset ])) ? $_SESSION[ $offset ] : null; |
|
749 | + return (isset($_SESSION['system_variables'], $_SESSION['system_variables'][$offset], $_SESSION[$offset]) && |
|
750 | + ! is_int($_SESSION['system_variables'][$offset])) ? $_SESSION[$offset] : null; |
|
751 | 751 | } |
752 | 752 | |
753 | 753 | $flashVariables = []; |
754 | 754 | |
755 | - if ( ! empty($_SESSION[ 'system_variables' ])) { |
|
756 | - foreach ($_SESSION[ 'system_variables' ] as $offset => &$value) { |
|
757 | - is_int($value) OR $flashVariables[ $offset ] = $_SESSION[ $offset ]; |
|
755 | + if ( ! empty($_SESSION['system_variables'])) { |
|
756 | + foreach ($_SESSION['system_variables'] as $offset => &$value) { |
|
757 | + is_int($value) OR $flashVariables[$offset] = $_SESSION[$offset]; |
|
758 | 758 | } |
759 | 759 | } |
760 | 760 | |
@@ -786,23 +786,23 @@ discard block |
||
786 | 786 | */ |
787 | 787 | public function unsetFlash($offset) |
788 | 788 | { |
789 | - if (empty($_SESSION[ 'system_variables' ])) { |
|
789 | + if (empty($_SESSION['system_variables'])) { |
|
790 | 790 | return; |
791 | 791 | } |
792 | 792 | |
793 | 793 | is_array($offset) OR $offset = [$offset]; |
794 | 794 | |
795 | 795 | foreach ($offset as $key) { |
796 | - if (isset($_SESSION[ 'system_variables' ][ $key ]) && ! is_int( |
|
797 | - $_SESSION[ 'system_variables' ][ $key ] |
|
796 | + if (isset($_SESSION['system_variables'][$key]) && ! is_int( |
|
797 | + $_SESSION['system_variables'][$key] |
|
798 | 798 | ) |
799 | 799 | ) { |
800 | - unset($_SESSION[ 'system_variables' ][ $key ]); |
|
800 | + unset($_SESSION['system_variables'][$key]); |
|
801 | 801 | } |
802 | 802 | } |
803 | 803 | |
804 | - if (empty($_SESSION[ 'system_variables' ])) { |
|
805 | - unset($_SESSION[ 'system_variables' ]); |
|
804 | + if (empty($_SESSION['system_variables'])) { |
|
805 | + unset($_SESSION['system_variables']); |
|
806 | 806 | } |
807 | 807 | } |
808 | 808 | |
@@ -817,13 +817,13 @@ discard block |
||
817 | 817 | */ |
818 | 818 | public function getFlashOffsets() |
819 | 819 | { |
820 | - if ( ! isset($_SESSION[ 'system_variables' ])) { |
|
820 | + if ( ! isset($_SESSION['system_variables'])) { |
|
821 | 821 | return []; |
822 | 822 | } |
823 | 823 | |
824 | 824 | $offsets = []; |
825 | - foreach (array_keys($_SESSION[ 'system_variables' ]) as $offset) { |
|
826 | - is_int($_SESSION[ 'system_variables' ][ $offset ]) OR $offsets[] = $offset; |
|
825 | + foreach (array_keys($_SESSION['system_variables']) as $offset) { |
|
826 | + is_int($_SESSION['system_variables'][$offset]) OR $offsets[] = $offset; |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | return $offsets; |
@@ -875,26 +875,26 @@ discard block |
||
875 | 875 | $value += time(); |
876 | 876 | } |
877 | 877 | |
878 | - if ( ! isset($_SESSION[ $key ])) { |
|
878 | + if ( ! isset($_SESSION[$key])) { |
|
879 | 879 | return false; |
880 | 880 | } |
881 | 881 | |
882 | - $temp[ $key ] = $value; |
|
882 | + $temp[$key] = $value; |
|
883 | 883 | } |
884 | 884 | |
885 | - $_SESSION[ 'system_variables' ] = isset($_SESSION[ 'system_variables' ]) ? array_merge( |
|
886 | - $_SESSION[ 'system_variables' ], |
|
885 | + $_SESSION['system_variables'] = isset($_SESSION['system_variables']) ? array_merge( |
|
886 | + $_SESSION['system_variables'], |
|
887 | 887 | $temp |
888 | 888 | ) : $temp; |
889 | 889 | |
890 | 890 | return true; |
891 | 891 | } |
892 | 892 | |
893 | - if ( ! isset($_SESSION[ $offset ])) { |
|
893 | + if ( ! isset($_SESSION[$offset])) { |
|
894 | 894 | return false; |
895 | 895 | } |
896 | 896 | |
897 | - $_SESSION[ 'system_variables' ][ $offset ] = $ttl; |
|
897 | + $_SESSION['system_variables'][$offset] = $ttl; |
|
898 | 898 | |
899 | 899 | return true; |
900 | 900 | } |
@@ -913,15 +913,15 @@ discard block |
||
913 | 913 | public function getTemp($offset = null) |
914 | 914 | { |
915 | 915 | if (isset($offset)) { |
916 | - return (isset($_SESSION[ 'system_variables' ], $_SESSION[ 'system_variables' ][ $offset ], $_SESSION[ $offset ]) && |
|
917 | - is_int($_SESSION[ 'system_variables' ][ $offset ])) ? $_SESSION[ $offset ] : null; |
|
916 | + return (isset($_SESSION['system_variables'], $_SESSION['system_variables'][$offset], $_SESSION[$offset]) && |
|
917 | + is_int($_SESSION['system_variables'][$offset])) ? $_SESSION[$offset] : null; |
|
918 | 918 | } |
919 | 919 | |
920 | 920 | $tempVariables = []; |
921 | 921 | |
922 | - if ( ! empty($_SESSION[ 'system_variables' ])) { |
|
923 | - foreach ($_SESSION[ 'system_variables' ] as $offset => &$value) { |
|
924 | - is_int($value) && $tempVariables[ $offset ] = $_SESSION[ $offset ]; |
|
922 | + if ( ! empty($_SESSION['system_variables'])) { |
|
923 | + foreach ($_SESSION['system_variables'] as $offset => &$value) { |
|
924 | + is_int($value) && $tempVariables[$offset] = $_SESSION[$offset]; |
|
925 | 925 | } |
926 | 926 | } |
927 | 927 | |
@@ -939,23 +939,23 @@ discard block |
||
939 | 939 | */ |
940 | 940 | public function unsetTemp($offset) |
941 | 941 | { |
942 | - if (empty($_SESSION[ 'system_variables' ])) { |
|
942 | + if (empty($_SESSION['system_variables'])) { |
|
943 | 943 | return; |
944 | 944 | } |
945 | 945 | |
946 | 946 | is_array($offset) OR $offset = [$offset]; |
947 | 947 | |
948 | 948 | foreach ($offset as $key) { |
949 | - if (isset($_SESSION[ 'system_variables' ][ $key ]) && is_int( |
|
950 | - $_SESSION[ 'system_variables' ][ $key ] |
|
949 | + if (isset($_SESSION['system_variables'][$key]) && is_int( |
|
950 | + $_SESSION['system_variables'][$key] |
|
951 | 951 | ) |
952 | 952 | ) { |
953 | - unset($_SESSION[ 'system_variables' ][ $key ]); |
|
953 | + unset($_SESSION['system_variables'][$key]); |
|
954 | 954 | } |
955 | 955 | } |
956 | 956 | |
957 | - if (empty($_SESSION[ 'system_variables' ])) { |
|
958 | - unset($_SESSION[ 'system_variables' ]); |
|
957 | + if (empty($_SESSION['system_variables'])) { |
|
958 | + unset($_SESSION['system_variables']); |
|
959 | 959 | } |
960 | 960 | } |
961 | 961 | |
@@ -970,13 +970,13 @@ discard block |
||
970 | 970 | */ |
971 | 971 | public function getTempOffsets() |
972 | 972 | { |
973 | - if ( ! isset($_SESSION[ 'system_variables' ])) { |
|
973 | + if ( ! isset($_SESSION['system_variables'])) { |
|
974 | 974 | return []; |
975 | 975 | } |
976 | 976 | |
977 | 977 | $offsets = []; |
978 | - foreach (array_keys($_SESSION[ 'system_variables' ]) as $offset) { |
|
979 | - is_int($_SESSION[ 'system_variables' ][ $offset ]) && $offsets[] = $offset; |
|
978 | + foreach (array_keys($_SESSION['system_variables']) as $offset) { |
|
979 | + is_int($_SESSION['system_variables'][$offset]) && $offsets[] = $offset; |
|
980 | 980 | } |
981 | 981 | |
982 | 982 | return $offsets; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $this->config = $config; |
111 | 111 | $this->config->offsetUnset('handler'); |
112 | - $this->setPrefixKey($this->config[ 'name' ]); |
|
112 | + $this->setPrefixKey($this->config['name']); |
|
113 | 113 | |
114 | 114 | if (is_php('7')) { |
115 | 115 | $this->success = true; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function setLogger(LoggerInterface $logger) |
149 | 149 | { |
150 | - $this->logger =& $logger; |
|
150 | + $this->logger = & $logger; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -333,12 +333,12 @@ discard block |
||
333 | 333 | protected function destroyCookie() |
334 | 334 | { |
335 | 335 | return setcookie( |
336 | - $this->config[ 'name' ], |
|
336 | + $this->config['name'], |
|
337 | 337 | null, |
338 | 338 | 1, |
339 | - $this->config[ 'cookie' ]->path, |
|
340 | - '.' . ltrim($this->config[ 'cookie' ]->domain, '.'), |
|
341 | - $this->config[ 'cookie' ]->secure, |
|
339 | + $this->config['cookie']->path, |
|
340 | + '.' . ltrim($this->config['cookie']->domain, '.'), |
|
341 | + $this->config['cookie']->secure, |
|
342 | 342 | true |
343 | 343 | ); |
344 | 344 | } |