From bc373868d9ef05977d17d2ddaa10b5f12266f7f9 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 31 Jul 2020 17:10:25 +0200 Subject: [PATCH] Prevent writes to the session rather than reads --- .../files/lib/system/visitTracker/VisitTracker.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php b/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php index 3b94acb025..2ce897bf75 100644 --- a/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php +++ b/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php @@ -85,7 +85,7 @@ class VisitTracker extends SingletonFactory { $this->userVisits = @unserialize($data); } } - else if (WCF::getSession()->spiderID === null) { + else { $this->userVisits = WCF::getSession()->getVar('trackedUserVisits'); } @@ -128,7 +128,7 @@ class VisitTracker extends SingletonFactory { $row = $statement->fetchArray(); if ($row) return $row['visitTime']; } - else if (WCF::getSession()->spiderID === null) { + else { if ($visitTime = WCF::getSession()->getVar('trackedUserVisit_'.$this->getObjectTypeID($objectType).'_'.$objectID)) { return $visitTime; } @@ -192,7 +192,7 @@ class VisitTracker extends SingletonFactory { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->getObjectTypeID($objectType), $objectID, WCF::getUser()->userID, $time]); } - else { + else if (WCF::getSession()->spiderID === null) { WCF::getSession()->register('trackedUserVisit_'.$this->getObjectTypeID($objectType).'_'.$objectID, $time); } } @@ -223,7 +223,7 @@ class VisitTracker extends SingletonFactory { // reset storage UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'trackedUserVisits'); } - else { + else if (WCF::getSession()->spiderID === null) { $this->getVisitTime($objectType); $this->userVisits[$this->getObjectTypeID($objectType)] = $time; WCF::getSession()->register('trackedUserVisits', $this->userVisits); -- 2.20.1