Break accidental references in Parser::__clone
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 22 Sep 2014 16:49:28 +0000 (12:49 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 22 Sep 2014 17:44:49 +0000 (13:44 -0400)
commit8eeb906f93e67c43122fe3de4548b3d05bc8962c
treef2085be7d733162316c0b810548787c0cc4a7c37
parent4b3e1b6d53d77c9cc68c6b9f4aaa61081c05fd03
Break accidental references in Parser::__clone

If you have a reference *to* an object field (anywhere in the call
stack) when you clone the object, the field will be cloned as a
reference rather than as a value.

So we have to break those unexpected references in the cloned object
manually, which is easy enough by making a non-reference copy and then
rebinding the cloned object's reference to this copy.

Bug: 56226
Change-Id: I9c600e9c0845b4fde0366126ce3809d74e2240b4
includes/parser/Parser.php