r106916 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106915‎ | r106916 | r106917 >
Date:01:22, 21 December 2011
Author:bsitu
Status:deferred
Tags:markashelpful 
Comment:
Adding MarkAsHelpful type check in API so that unsupported types will be caught before deep code execution
Modified paths:
  • /trunk/extensions/MarkAsHelpful/api/ApiGetMarkAsHelpfulItem.php (modified) (history)
  • /trunk/extensions/MarkAsHelpful/api/ApiMarkAsHelpful.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MarkAsHelpful/api/ApiGetMarkAsHelpfulItem.php
@@ -28,10 +28,12 @@
2929 }
3030
3131 public function getAllowedParams() {
 32+ global $wgMarkAsHelpfulType;
 33+
3234 return array(
3335 'type' => array(
3436 ApiBase::PARAM_REQUIRED => true,
35 - ApiBase::PARAM_TYPE => 'string',
 37+ ApiBase::PARAM_TYPE => $wgMarkAsHelpfulType,
3638 ),
3739 'item' => array(
3840 ApiBase::PARAM_REQUIRED => true,
Index: trunk/extensions/MarkAsHelpful/api/ApiMarkAsHelpful.php
@@ -72,6 +72,8 @@
7373 }
7474
7575 public function getAllowedParams() {
 76+ global $wgMarkAsHelpfulType;
 77+
7678 return array(
7779 'mahaction' => array(
7880 ApiBase::PARAM_REQUIRED => true,
@@ -82,7 +84,7 @@
8385 ),
8486 'type' => array(
8587 ApiBase::PARAM_REQUIRED => true,
86 - ApiBase::PARAM_TYPE => 'string',
 88+ ApiBase::PARAM_TYPE => $wgMarkAsHelpfulType,
8789 ),
8890 'item' => array(
8991 ApiBase::PARAM_REQUIRED => true,

Status & tagging log