Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index 44e6a24..4fdacc5 100644 (file)
@@ -232,7 +232,7 @@ class DifferenceEngine extends ContextSource {
                        ->params( $this->getLanguage()->listToText( $missing ) )
                        ->numParams( count( $missing ) )
                        ->parseAsBlock();
-               $out->addHtml( $msg );
+               $out->addHTML( $msg );
        }
 
        public function showDiffPage( $diffOnly = false ) {
@@ -715,7 +715,7 @@ class DifferenceEngine extends ContextSource {
                }
                // Short-circuit
                if ( $this->mOldRev === false || ( $this->mOldRev && $this->mNewRev
-                       && $this->mOldRev->getID() == $this->mNewRev->getID() )
+                       && $this->mOldRev->getId() == $this->mNewRev->getId() )
                ) {
                        return '';
                }
@@ -846,8 +846,13 @@ class DifferenceEngine extends ContextSource {
 
                $result = $this->textDiff( $otext, $ntext );
 
-               $time = microtime( true ) - $time;
-               $this->getStats()->timing( 'diff_time', $time * 1000 );
+               $time = intval( ( microtime( true ) - $time ) * 1000 );
+               $this->getStats()->timing( 'diff_time', $time );
+               // Log requests slower than 99th percentile
+               if ( $time > 100 && $this->mOldPage && $this->mNewPage ) {
+                       wfDebugLog( 'diff',
+                               "$time ms diff: {$this->mOldid} -> {$this->mNewid} {$this->mNewPage}" );
+               }
 
                return $result;
        }
@@ -1055,12 +1060,12 @@ class DifferenceEngine extends ContextSource {
                $title = $rev->getTitle();
 
                $header = Linker::linkKnown( $title, $header, [],
-                       [ 'oldid' => $rev->getID() ] );
+                       [ 'oldid' => $rev->getId() ] );
 
                if ( $rev->userCan( Revision::DELETED_TEXT, $user ) ) {
                        $editQuery = [ 'action' => 'edit' ];
                        if ( !$rev->isCurrent() ) {
-                               $editQuery['oldid'] = $rev->getID();
+                               $editQuery['oldid'] = $rev->getId();
                        }
 
                        $key = $title->quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold';