Merge "mw.Feedback: If the message is posted remotely, link the title correctly"
[lhc/web/wiklou.git] / includes / Storage / RevisionStore.php
index 79ecec6..b6a751b 100644 (file)
@@ -1484,29 +1484,13 @@ class RevisionStore implements IDBAccessObject, RevisionFactory, RevisionLookup
         * @throws MWException
         */
        private function checkDatabaseWikiId( IDatabase $db ) {
-               $storeWiki = $this->wikiId;
+               $storeWiki = $this->loadBalancer->getLocalDomainID();
                $dbWiki = $db->getDomainID();
 
                if ( $dbWiki === $storeWiki ) {
                        return;
                }
 
-               // XXX: we really want the default database ID...
-               $storeWiki = $storeWiki ?: wfWikiID();
-               $dbWiki = $dbWiki ?: wfWikiID();
-
-               if ( $dbWiki === $storeWiki ) {
-                       return;
-               }
-
-               // HACK: counteract encoding imposed by DatabaseDomain
-               $storeWiki = str_replace( '?h', '-', $storeWiki );
-               $dbWiki = str_replace( '?h', '-', $dbWiki );
-
-               if ( $dbWiki === $storeWiki ) {
-                       return;
-               }
-
                throw new MWException( "RevisionStore for $storeWiki "
                        . "cannot be used with a DB connection for $dbWiki" );
        }