Merge "Move cookie-blocking methods to BlockManager"
[lhc/web/wiklou.git] / includes / page / ImagePage.php
index 66804bc..e929ed8 100644 (file)
@@ -75,9 +75,10 @@ class ImagePage extends Article {
 
                Hooks::run( 'ImagePageFindFile', [ $this, &$img, &$this->displayImg ] );
                if ( !$img ) { // not set by hook?
-                       $img = wfFindFile( $this->getTitle() );
+                       $services = MediaWikiServices::getInstance();
+                       $img = $services->getRepoGroup()->findFile( $this->getTitle() );
                        if ( !$img ) {
-                               $img = wfLocalFile( $this->getTitle() );
+                               $img = $services->getRepoGroup()->getLocalRepo()->newFile( $this->getTitle() );
                        }
                }
                $this->mPage->setFile( $img );
@@ -321,9 +322,7 @@ class ImagePage extends Article {
                $dirmark = $lang->getDirMarkEntity();
                $request = $this->getContext()->getRequest();
 
-               $max = $this->getImageLimitsFromOption( $user, 'imagesize' );
-               $maxWidth = $max[0];
-               $maxHeight = $max[1];
+               list( $maxWidth, $maxHeight ) = $this->getImageLimitsFromOption( $user, 'imagesize' );
 
                if ( $this->displayImg->exists() ) {
                        # image
@@ -963,7 +962,7 @@ EOT
                $out->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );
 
                /**
-                * @var $file File
+                * @var File $file
                 */
                foreach ( $dupes as $file ) {
                        $fromSrc = '';
@@ -1029,7 +1028,7 @@ EOT
         *
         * @param User $user
         * @param string $optionName Name of a option to check, typically imagesize or thumbsize
-        * @return array
+        * @return int[]
         * @since 1.21
         */
        public function getImageLimitsFromOption( $user, $optionName ) {
@@ -1224,7 +1223,7 @@ EOT
         * @return TitleArray|Title[]
         */
        public function getForeignCategories() {
-               $this->mPage->getForeignCategories();
+               return $this->mPage->getForeignCategories();
        }
 
 }