X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fapi%2FApiQueryStashImageInfo.php;h=c84de8c97448c71d51b2e26d15c1e675377effc2;hb=e19e6bfabcaf2b6aa5dd837ff7057bd6a25baef8;hp=1924ca0339a86092329fb0a2e05b29274e12d73b;hpb=036b9c41674a8eb1bdcd71a15fffb5a091223d9e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index 1924ca0339..c84de8c974 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -70,11 +70,37 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { } } - private $propertyFilter = [ + private static $propertyFilter = [ 'user', 'userid', 'comment', 'parsedcomment', 'mediatype', 'archivename', 'uploadwarning', ]; + /** + * Returns all possible parameters to siiprop + * + * @param array|null $filter List of properties to filter out + * @return array + */ + public static function getPropertyNames( $filter = null ) { + if ( $filter === null ) { + $filter = self::$propertyFilter; + } + return parent::getPropertyNames( $filter ); + } + + /** + * Returns messages for all possible parameters to siiprop + * + * @param array|null $filter List of properties to filter out + * @return array + */ + public static function getPropertyMessages( $filter = null ) { + if ( $filter === null ) { + $filter = self::$propertyFilter; + } + return parent::getPropertyMessages( $filter ); + } + public function getAllowedParams() { return [ 'filekey' => [ @@ -87,9 +113,9 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { 'prop' => [ ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_DFLT => 'timestamp|url', - ApiBase::PARAM_TYPE => self::getPropertyNames( $this->propertyFilter ), + ApiBase::PARAM_TYPE => self::getPropertyNames(), ApiBase::PARAM_HELP_MSG => 'apihelp-query+imageinfo-param-prop', - ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages( $this->propertyFilter ) + ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages() ], 'urlwidth' => [ ApiBase::PARAM_TYPE => 'integer',