r73742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73741‎ | r73742 | r73743 >
Date:11:30, 25 September 2010
Author:reedy
Status:deferred
Tags:
Comment:
Bug 25290 - ArticleAssessmentPilot: parameter validation

Use 'limit', type, which if value provided > MAX, it will use the defined max

Maybe we should have a PARAM_MAX_ENFORCE. Rather than just warning!
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/api/ApiQueryArticleAssessment.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/api/ApiQueryArticleAssessment.php
@@ -26,7 +26,7 @@
2727
2828 if ( $params['userrating'] ) {
2929 global $wgUser;
30 -
 30+
3131 $leftJoinConds = array(
3232 'aa_page_id=aap_page_id',
3333 'aa_rating_id=aap_rating_id',
@@ -95,7 +95,7 @@
9696 //Only can actually be "stale" if the user has rated the article before
9797 if ( $params['userrating'] && $userRatedArticle ) {
9898 $dbr = wfGetDb( DB_SLAVE );
99 -
 99+
100100 global $wgArticleAssessmentStaleCount;
101101
102102 $res = $dbr->select(
Index: trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php
@@ -122,7 +122,7 @@
123123 */
124124 private function insertUserRatings( $pageId, $revisionId, $user, $token, $ratingId, $ratingValue ) {
125125 $dbw = wfGetDB( DB_MASTER );
126 -
 126+
127127 $timestamp = $dbw->timestamp();
128128
129129 $dbw->insert(
@@ -179,7 +179,7 @@
180180 ),
181181 'anontoken' => null,
182182 );
183 -
 183+
184184 foreach( $wgArticleAssessmentRatings as $rating ) {
185185 $ret["r{$rating}"] = array(
186186 ApiBase::PARAM_TYPE => 'integer',
@@ -209,7 +209,7 @@
210210 'Submit article assessments'
211211 );
212212 }
213 -
 213+
214214 public function mustBePosted() {
215215 return true;
216216 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r73743Actually do r73742reedy11:38, 25 September 2010

Status & tagging log