User: support setting custom fields + array autocreation in non-existent field
authorGergő Tisza <tgr.huwiki@gmail.com>
Wed, 10 Jul 2019 18:46:21 +0000 (20:46 +0200)
committerGergő Tisza <gtisza@wikimedia.org>
Wed, 10 Jul 2019 20:35:56 +0000 (20:35 +0000)
commitb530dca430a7553fd25df7c5dc327c1395928e51
tree3a80e22c987e3b1639f09fcf160ffa37cee0ea89
parente0cf8b94bbbae5a04ecd1c581e03127bf79f60b9
User: support setting custom fields + array autocreation in non-existent field

I889924037 added a __set method which did not actually handle fields being set.
For better or worse, setting custom fields on ubiquitous objects like User is a
common form of in-process caching, so this is a B/C break; restore for now.

PHP allows creating an array in a previously non-existent object property
with $o->foo['bar'] = $val, but doesn't properly handle that on objects
which have magic getter/setter. Add an ugly hack to make it work (but warn).

Depends on I15090ae9e4b66ac25f631f6179c4394ce8c445a9.

Bug: T227688
Change-Id: I62b80ab4fa10de984cf2c879ab12d91b0fd9bc1c
includes/user/User.php