Improve readability of SessionHandler::deleteIfNew()
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 29 Mar 2019 13:20:00 +0000 (14:20 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 29 Mar 2019 13:20:00 +0000 (14:20 +0100)
wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index f70c52f17d6b31d7a6b825a6fb54b283b294f962..e65eb82e7c259f78e82ab16902f59bbcbf51dbe9 100644 (file)
@@ -1002,10 +1002,9 @@ class SessionHandler extends SingletonFactory {
         * @since 5.2
         */
        public function deleteIfNew() {
-               if (!$this->isFirstVisit()) return;
-               if ($this->getUser()->userID) return;
-               
-               $this->delete();
+               if ($this->isFirstVisit() && !$this->getUser()->userID) {
+                       $this->delete();
+               }
        }
        
        /**