From: Sam Reed Date: Thu, 30 Dec 2010 00:56:30 +0000 (+0000) Subject: Per CR on r68482, fix adss to add X-Git-Tag: 1.31.0-rc.0~32994 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=e0373cc45017a6e64bc388aab18a50f0398fc582;p=lhc%2Fweb%2Fwiklou.git Per CR on r68482, fix adss to add Also remove trailing whitespace in files --- diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index f951855ad9..02def1a272 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -179,10 +179,10 @@ class ApiQueryImageInfo extends ApiQueryBase { } /** - * From parameters, construct a 'scale' array - * @param $params Array: + * From parameters, construct a 'scale' array + * @param $params Array: * @return Array or Null: key-val array of 'width' and 'height', or null - */ + */ public function getScale( $params ) { $p = $this->getModulePrefix(); if ( $params['urlheight'] != -1 && $params['urlwidth'] == -1 ) { @@ -230,7 +230,7 @@ class ApiQueryImageInfo extends ApiQueryBase { $vals['size'] = intval( $file->getSize() ); $vals['width'] = intval( $file->getWidth() ); $vals['height'] = intval( $file->getHeight() ); - + $pageCount = $file->pageCount(); if ( $pageCount !== false ) { $vals['pagecount'] = $pageCount; @@ -266,10 +266,10 @@ class ApiQueryImageInfo extends ApiQueryBase { } if ( isset( $prop['parsedcomment'] ) ) { global $wgUser; - $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( + $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $file->getDescription(), $file->getTitle() ); } - + if ( isset( $prop['sha1'] ) ) { $vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 16, 40 ); } @@ -380,7 +380,7 @@ class ApiQueryImageInfo extends ApiQueryBase { /** - * Return the API documentation for the parameters. + * Return the API documentation for the parameters. * @return {Array} parameter documentation. */ public function getParamDescription() { @@ -398,7 +398,7 @@ class ApiQueryImageInfo extends ApiQueryBase { ' dimensions - Alias for size', ' sha1 - Adds SHA-1 hash for the image', ' mime - Adds MIME type of the image', - ' thumbmime - Adss MIME type of the image thumbnail (requires url)', + ' thumbmime - Adds MIME type of the image thumbnail (requires url)', ' metadata - Lists EXIF metadata for the version of the image', ' archivename - Adds the file name of the archive version for non-latest versions', ' bitdepth - Adds the bit depth of the version', diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index ff09a63321..73bad15b4a 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -38,13 +38,13 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { $prop = array_flip( $params['prop'] ); $scale = $this->getScale( $params ); - + $result = $this->getResult(); - + try { $stash = new UploadStash(); - - foreach ( $params['sessionkey'] as $sessionkey ) { + + foreach ( $params['sessionkey'] as $sessionkey ) { $file = $stash->getFile( $sessionkey ); $imageInfo = self::getInfo( $file, $prop, $result, $scale ); $result->addValue( array( 'query', $this->getModuleName() ), null, $imageInfo ); @@ -57,8 +57,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { $this->dieUsage( "File not found: " . $e->getMessage(), "invalidsessiondata" ); } catch ( UploadStashBadPathException $e ) { $this->dieUsage( "Bad path: " . $e->getMessage(), "invalidsessiondata" ); - } - + } } /** @@ -81,7 +80,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { public function getAllowedParams() { return array( - 'sessionkey' => array( + 'sessionkey' => array( ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_REQUIRED => true, ApiBase::PARAM_DFLT => null @@ -117,7 +116,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { ' dimensions - Alias for size', ' sha1 - Adds sha1 hash for the image', ' mime - Adds MIME of the image', - ' thumbmime - Adss MIME of the image thumbnail (requires url)', + ' thumbmime - Adds MIME of the image thumbnail (requires url)', ' metadata - Lists EXIF metadata for the version of the image', ' bitdepth - Adds the bit depth of the version', ),