dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84f623b
)
API param validation: Set strict mode for in_array
author
umherirrender
<umherirrender_de.wp@web.de>
Tue, 2 Apr 2013 10:05:50 +0000
(12:05 +0200)
committer
umherirrender
<umherirrender_de.wp@web.de>
Tue, 2 Apr 2013 10:05:50 +0000
(12:05 +0200)
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
includes/api/ApiBase.php
patch
|
blob
|
history
diff --git
a/includes/api/ApiBase.php
b/includes/api/ApiBase.php
index
741e908
..
84a6ed9
100644
(file)
--- 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;
}