Drop the check for existences of LocalSettings.php in MediaWikiIntegrationTestCase
[lhc/web/wiklou.git] / includes / Linker.php
index ae50c66..f3d492f 100644 (file)
@@ -89,12 +89,6 @@ class Linker {
                        return "<!-- ERROR -->$html";
                }
 
-               if ( is_string( $query ) ) {
-                       // some functions withing core using this still hand over query strings
-                       wfDeprecated( __METHOD__ . ' with parameter $query as string (should be array)', '1.20' );
-                       $query = wfCgiToArray( $query );
-               }
-
                $services = MediaWikiServices::getInstance();
                $options = (array)$options;
                if ( $options ) {
@@ -555,7 +549,8 @@ class Linker {
                                # Use manually specified thumbnail
                                $manual_title = Title::makeTitleSafe( NS_FILE, $frameParams['manualthumb'] );
                                if ( $manual_title ) {
-                                       $manual_img = wfFindFile( $manual_title );
+                                       $manual_img = MediaWikiServices::getInstance()->getRepoGroup()
+                                               ->findFile( $manual_title );
                                        if ( $manual_img ) {
                                                $thumb = $manual_img->getUnscaledThumb( $handlerParams );
                                                $manualthumb = true;
@@ -693,7 +688,8 @@ class Linker {
                        $label = $title->getPrefixedText();
                }
                $encLabel = htmlspecialchars( $label );
-               $currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
+               $currentExists = $time
+                       && MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title ) !== false;
 
                if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads )
                        && !$currentExists
@@ -756,11 +752,13 @@ class Linker {
         * @since 1.16.3
         * @param LinkTarget $title
         * @param string $html Pre-sanitized HTML
-        * @param string $time MW timestamp of file creation time
+        * @param string|false $time MW timestamp of file creation time
         * @return string HTML
         */
        public static function makeMediaLinkObj( $title, $html = '', $time = false ) {
-               $img = wfFindFile( $title, [ 'time' => $time ] );
+               $img = MediaWikiServices::getInstance()->getRepoGroup()->findFile(
+                       $title, [ 'time' => $time ]
+               );
                return self::makeMediaLinkFile( $title, $img, $html );
        }
 
@@ -1118,17 +1116,22 @@ class Linker {
         * @return string HTML
         */
        public static function revUserTools( $rev, $isPublic = false, $useParentheses = true ) {
-               if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
-                       $link = wfMessage( 'rev-deleted-user' )->escaped();
-               } elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
+               if ( $rev->userCan( Revision::DELETED_USER ) &&
+                       ( !$rev->isDeleted( Revision::DELETED_USER ) || !$isPublic )
+               ) {
                        $userId = $rev->getUser( Revision::FOR_THIS_USER );
                        $userText = $rev->getUserText( Revision::FOR_THIS_USER );
-                       $link = self::userLink( $userId, $userText )
-                               . self::userToolLinks( $userId, $userText, false, 0, null,
-                                       $useParentheses );
-               } else {
+                       if ( $userId && $userText ) {
+                               $link = self::userLink( $userId, $userText )
+                                       . self::userToolLinks( $userId, $userText, false, 0, null,
+                                               $useParentheses );
+                       }
+               }
+
+               if ( !isset( $link ) ) {
                        $link = wfMessage( 'rev-deleted-user' )->escaped();
                }
+
                if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
                        return ' <span class="history-deleted mw-userlink">' . $link . '</span>';
                }