getValueWithDefault( $this->xmlNode ); $node['url'] = $this->resolveImageUrl( $imageName ); $node['name'] = $imageName; $node['alt'] = $this->getValueWithDefault( $this->xmlNode->{self::ALT_TAG_NAME} ); return $node; } public function isEmpty( $data ) { return !( isset( $data[ 'url' ] ) ) || empty( $data[ 'url' ] ); } public function resolveImageUrl( $filename ) { global $wgContLang; $title = \Title::newFromText( \Wikia\PortableInfobox\Helpers\ImageFilenameSanitizer::getInstance() ->sanitizeImageFileName($filename, $wgContLang), NS_FILE ); if ( $title && $title->exists() ) { return \WikiaFileHelper::getFileFromTitle( $title )->getUrlGenerator()->url(); } else { return ""; } } }