X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryUserContributions.php;h=480a1ab36ba885eda29c08139c9b8fc336acb7e9;hb=414aa39026ffe5d0ce7fd9d744e19e7be8482e8d;hp=10d62cb10d54d2fb35f0f5ca98290e033e4db4f4;hpb=08aaea93e300d3b34befdbd30368c1293973760e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 10d62cb10d..480a1ab36b 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -120,7 +120,7 @@ class ApiQueryContributions extends ApiQueryBase { } } - $this->getResult()->setIndexedTagName_internal( + $this->getResult()->addIndexedTagName( array( 'query', $this->getModuleName() ), 'item' ); @@ -335,15 +335,15 @@ class ApiQueryContributions extends ApiQueryBase { $anyHidden = false; if ( $row->rev_deleted & Revision::DELETED_TEXT ) { - $vals['texthidden'] = ''; + $vals['texthidden'] = true; $anyHidden = true; } // Any rows where we can't view the user were filtered out in the query. - $vals['userid'] = $row->rev_user; + $vals['userid'] = (int)$row->rev_user; $vals['user'] = $row->rev_user_text; if ( $row->rev_deleted & Revision::DELETED_USER ) { - $vals['userhidden'] = ''; + $vals['userhidden'] = true; $anyHidden = true; } if ( $this->fld_ids ) { @@ -367,20 +367,14 @@ class ApiQueryContributions extends ApiQueryBase { } if ( $this->fld_flags ) { - if ( $row->rev_parent_id == 0 && !is_null( $row->rev_parent_id ) ) { - $vals['new'] = ''; - } - if ( $row->rev_minor_edit ) { - $vals['minor'] = ''; - } - if ( $row->page_latest == $row->rev_id ) { - $vals['top'] = ''; - } + $vals['new'] = $row->rev_parent_id == 0 && !is_null( $row->rev_parent_id ); + $vals['minor'] = (bool)$row->rev_minor_edit; + $vals['top'] = $row->page_latest == $row->rev_id; } if ( ( $this->fld_comment || $this->fld_parsedcomment ) && isset( $row->rev_comment ) ) { if ( $row->rev_deleted & Revision::DELETED_COMMENT ) { - $vals['commenthidden'] = ''; + $vals['commenthidden'] = true; $anyHidden = true; } @@ -400,8 +394,8 @@ class ApiQueryContributions extends ApiQueryBase { } } - if ( $this->fld_patrolled && $row->rc_patrolled ) { - $vals['patrolled'] = ''; + if ( $this->fld_patrolled ) { + $vals['patrolled'] = (bool)$row->rc_patrolled; } if ( $this->fld_size && !is_null( $row->rev_len ) ) { @@ -421,7 +415,7 @@ class ApiQueryContributions extends ApiQueryBase { if ( $this->fld_tags ) { if ( $row->ts_tags ) { $tags = explode( ',', $row->ts_tags ); - $this->getResult()->setIndexedTagName( $tags, 'tag' ); + ApiResult::setIndexedTagName( $tags, 'tag' ); $vals['tags'] = $tags; } else { $vals['tags'] = array(); @@ -429,7 +423,7 @@ class ApiQueryContributions extends ApiQueryBase { } if ( $anyHidden && $row->rev_deleted & Revision::DELETED_RESTRICTED ) { - $vals['suppressed'] = ''; + $vals['suppressed'] = true; } return $vals; @@ -524,7 +518,7 @@ class ApiQueryContributions extends ApiQueryBase { ); } - public function getExamplesMessages() { + protected function getExamplesMessages() { return array( 'action=query&list=usercontribs&ucuser=Example' => 'apihelp-query+usercontribs-example-user',