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