From: umherirrender Date: Tue, 2 Apr 2013 10:05:50 +0000 (+0200) Subject: API param validation: Set strict mode for in_array X-Git-Tag: 1.31.0-rc.0~20136^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=a06611755a83d518eca4321cdd3474c6bc28f472;p=lhc%2Fweb%2Fwiklou.git API param validation: Set strict mode for in_array The in_array gives true when the allowed values contains a 0 as value, for example by namespaces, action=query&list=allpages&apnamespace=test|tset was not rejected Change-Id: I9220a955ffaf2bcb0d1d5b27c948af2f85714110 --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 741e908351..84a6ed95d4 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1081,7 +1081,7 @@ abstract class ApiBase extends ContextSource { if ( !$allowMultiple && count( $valuesList ) != 1 ) { // Bug 33482 - Allow entries with | in them for non-multiple values - if ( in_array( $value, $allowedValues ) ) { + if ( in_array( $value, $allowedValues, true ) ) { return $value; }