Move spiderID out of the environment array
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 14 Oct 2020 13:47:33 +0000 (15:47 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 15 Oct 2020 14:14:14 +0000 (16:14 +0200)
There is no better replacement as of now.

wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index 3d80654b586100724b7233379b0447d694b2cad2..0af227d686f106be286000fee700a51cb46427ba 100644 (file)
@@ -142,6 +142,9 @@ final class SessionHandler extends SingletonFactory {
                else if ($key === 'userID') {
                        return $this->user->userID;
                }
+               else if ($key === 'spiderID') {
+                       return $this->getSpiderID(UserUtil::getUserAgent());
+               }
                // TODO: pageID, pageObjectID, parentPageID, parentPageObjectID
                
                /** @deprecated 5.4 - These values can be retrieved more efficiently by directly using the methods in e.g. UserUtil. */
@@ -150,7 +153,6 @@ final class SessionHandler extends SingletonFactory {
                        'userAgent' => UserUtil::getUserAgent(),
                        'requestURI' => UserUtil::getRequestURI(),
                        'requestMethod' => !empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '',
-                       'spiderID' => $this->getSpiderID(UserUtil::getUserAgent()),
                        'lastActivityTime' => TIME_NOW,
                ];