Make use of \File::getArchiveRel to avoid code duplication
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 35a8c90..f5a954d 100644 (file)
@@ -684,9 +684,10 @@ class MediaWiki {
         */
        private static function getUrlDomainDistance( $url ) {
                $clusterWiki = WikiMap::getWikiFromUrl( $url );
-               if ( $clusterWiki === wfWikiID() ) {
+               if ( WikiMap::isCurrentWikiId( $clusterWiki ) ) {
                        return 'local'; // the current wiki
-               } elseif ( $clusterWiki !== false ) {
+               }
+               if ( $clusterWiki !== false ) {
                        return 'remote'; // another wiki in this cluster/farm
                }
 
@@ -892,8 +893,7 @@ class MediaWiki {
 
                // Loosen DB query expectations since the HTTP client is unblocked
                $trxProfiler = Profiler::instance()->getTransactionProfiler();
-               $trxProfiler->resetExpectations();
-               $trxProfiler->setExpectations(
+               $trxProfiler->redefineExpectations(
                        $this->context->getRequest()->hasSafeMethod()
                                ? $this->config->get( 'TrxProfilerLimits' )['PostSend-GET']
                                : $this->config->get( 'TrxProfilerLimits' )['PostSend-POST'],