Merge "Use WikiMap methods for wiki ID logic in more places"
[lhc/web/wiklou.git] / includes / user / User.php
index 43be06e..11cfd49 100644 (file)
@@ -2619,7 +2619,13 @@ class User implements IDBAccessObject, UserIdentity {
                        $this->isAnon() ? [ 'user_ip' => $this->getName() ] : [ 'user_id' => $this->getId() ],
                        __METHOD__ );
                $rev = $timestamp ? Revision::loadFromTimestamp( $dbr, $utp, $timestamp ) : null;
-               return [ [ 'wiki' => wfWikiID(), 'link' => $utp->getLocalURL(), 'rev' => $rev ] ];
+               return [
+                       [
+                               'wiki' => WikiMap::getWikiIdFromDomain( WikiMap::getCurrentWikiDomain() ),
+                               'link' => $utp->getLocalURL(),
+                               'rev' => $rev
+                       ]
+               ];
        }
 
        /**
@@ -2635,7 +2641,7 @@ class User implements IDBAccessObject, UserIdentity {
                        // and it is always for the same wiki, but we double-check here in
                        // case that changes some time in the future.
                        if ( count( $newMessageLinks ) === 1
-                               && $newMessageLinks[0]['wiki'] === wfWikiID()
+                               && WikiMap::isCurrentWikiId( $newMessageLinks[0]['wiki'] )
                                && $newMessageLinks[0]['rev']
                        ) {
                                /** @var Revision $newMessageRevision */