From 8e1834c8101b18afdce90f6e9b6ba2c1dd8fff04 Mon Sep 17 00:00:00 2001 From: Diana Date: Mon, 25 May 2015 11:02:35 +0000 Subject: [PATCH] unify the file creation method --- services/Parser/Nodes/NodeImage.php | 4 ++-- services/PortableInfoboxRenderService.class.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/services/Parser/Nodes/NodeImage.php b/services/Parser/Nodes/NodeImage.php index b61074d..4206707 100644 --- a/services/Parser/Nodes/NodeImage.php +++ b/services/Parser/Nodes/NodeImage.php @@ -41,8 +41,8 @@ class NodeImage extends Node { */ public function resolveImageUrl( $title ) { if ( $title ) { - $file = \WikiaFileHelper::getFileFromTitle($title); - if ($file) { + $file = \WikiaFileHelper::getFileFromTitle( $title ); + if ( $file ) { return $file->getUrl(); } } diff --git a/services/PortableInfoboxRenderService.class.php b/services/PortableInfoboxRenderService.class.php index 80248b1..c31c2af 100644 --- a/services/PortableInfoboxRenderService.class.php +++ b/services/PortableInfoboxRenderService.class.php @@ -185,7 +185,7 @@ class PortableInfoboxRenderService extends WikiaService { private function createVignetteThumbnail( $url ) { return VignetteRequest::fromUrl( $url ) ->thumbnailDown() - ->width(F::app()->checkSkin( 'wikiamobile' ) ? + ->width( F::app()->checkSkin( 'wikiamobile' ) ? self::MOBILE_THUMBNAIL_WIDTH : self::DESKTOP_THUMBNAIL_WIDTH ) @@ -197,15 +197,15 @@ class PortableInfoboxRenderService extends WikiaService { * @desc If the image is served from an old * service we have to again obtain file to * call the createThumb function - * @param $name + * @param $title * @return mixed */ - private function createOldThumbnail( $name ) + private function createOldThumbnail( $title ) { - $file = wfFindFile( $name ); + $file = \WikiaFileHelper::getFileFromTitle( $title ); if ( $file ) { return $file->createThumb( - F::app()->checkSkin('wikiamobile') ? + F::app()->checkSkin( 'wikiamobile' ) ? self::MOBILE_THUMBNAIL_WIDTH : self::DESKTOP_THUMBNAIL_WIDTH );