Merge "Revert "Hide HHVM tag on Special:{Contributions,RecentChanges,...}""
[lhc/web/wiklou.git] / includes / FeedUtils.php
index d407a0e..a01d642 100644 (file)
@@ -48,7 +48,7 @@ class FeedUtils {
        /**
         * Check whether feeds can be used and that $type is a valid feed type
         *
-        * @param string $type feed type, as requested by the user
+        * @param string $type Feed type, as requested by the user
         * @return bool
         */
        public static function checkFeedOutput( $type ) {
@@ -102,9 +102,10 @@ class FeedUtils {
         * @param string $actiontext Text of the action; in case of log event
         * @return string
         */
-       public static function formatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext = '' ) {
+       public static function formatDiffRow( $title, $oldid, $newid, $timestamp,
+               $comment, $actiontext = ''
+       ) {
                global $wgFeedDiffCutoff, $wgLang;
-               wfProfileIn( __METHOD__ );
 
                // log entries
                $completeText = '<p>' . implode( ' ',
@@ -122,12 +123,10 @@ class FeedUtils {
                // Can't diff special pages, unreadable pages or pages with no new revision
                // to compare against: just return the text.
                if ( $title->getNamespace() < 0 || $accErrors || !$newid ) {
-                       wfProfileOut( __METHOD__ );
                        return $completeText;
                }
 
                if ( $oldid ) {
-                       wfProfileIn( __METHOD__ . "-dodiff" );
 
                        #$diffText = $de->getDiff( wfMessage( 'revisionasof',
                        #       $wgLang->timeanddate( $timestamp ),
@@ -165,10 +164,9 @@ class FeedUtils {
                                $diffText = "<p>Can't load revision $newid</p>";
                        } else {
                                // Diff output fine, clean up any illegal UTF-8
-                               $diffText = UtfNormal::cleanUp( $diffText );
+                               $diffText = UtfNormal\Validator::cleanUp( $diffText );
                                $diffText = self::applyDiffStyle( $diffText );
                        }
-                       wfProfileOut( __METHOD__ . "-dodiff" );
                } else {
                        $rev = Revision::newFromId( $newid );
                        if ( $wgFeedDiffCutoff <= 0 || is_null( $rev ) ) {
@@ -206,7 +204,6 @@ class FeedUtils {
                }
                $completeText .= $diffText;
 
-               wfProfileOut( __METHOD__ );
                return $completeText;
        }
 
@@ -245,9 +242,15 @@ class FeedUtils {
                        'diff'             => 'background-color: white; color:black;',
                        'diff-otitle'      => 'background-color: white; color:black; text-align: center;',
                        'diff-ntitle'      => 'background-color: white; color:black; text-align: center;',
-                       'diff-addedline'   => 'color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;',
-                       'diff-deletedline' => 'color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;',
-                       'diff-context'     => 'background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;',
+                       'diff-addedline'   => 'color:black; font-size: 88%; border-style: solid; '
+                               . 'border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; '
+                               . 'vertical-align: top; white-space: pre-wrap;',
+                       'diff-deletedline' => 'color:black; font-size: 88%; border-style: solid; '
+                               . 'border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; '
+                               . 'vertical-align: top; white-space: pre-wrap;',
+                       'diff-context'     => 'background-color: #f9f9f9; color: #333333; font-size: 88%; '
+                               . 'border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; '
+                               . 'border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;',
                        'diffchange'       => 'font-weight: bold; text-decoration: none;',
                );