dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
070f457
)
Merge "Decode '0'-valued user options to integer 0"
author
jenkins-bot
<jenkins-bot@gerrit.wikimedia.org>
Sat, 25 Mar 2017 01:50:56 +0000
(
01:50
+0000)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Sat, 25 Mar 2017 01:50:56 +0000
(
01:50
+0000)
includes/user/User.php
patch
|
blob
|
history
diff --git
a/includes/user/User.php
b/includes/user/User.php
index
a963388
..
ef4537f
100644
(file)
--- a/
includes/user/User.php
+++ b/
includes/user/User.php
@@
-5266,6
+5266,13
@@
class User implements IDBAccessObject {
$this->mOptionOverrides = [];
$data = [];
foreach ( $res as $row ) {
+ // Convert '0' to 0. PHP's boolean conversion considers them both
+ // false, but e.g. JavaScript considers the former as true.
+ // @todo: T54542 Somehow determine the desired type (string/int/bool)
+ // and convert all values here.
+ if ( $row->up_value === '0' ) {
+ $row->up_value = 0;
+ }
$data[$row->up_property] = $row->up_value;
}
}