Fix bug where a % in a serialized array can lead to the data being broken
authoreileen <emcnaughton@wikimedia.org>
Wed, 11 Mar 2020 00:09:42 +0000 (13:09 +1300)
committereileen <emcnaughton@wikimedia.org>
Wed, 11 Mar 2020 23:54:50 +0000 (12:54 +1300)
commit2e09a60f5690e63d106a5efedfdcf888240db3e2
tree904040b0204eb3115a74fb3fa0ffcdacff06d1d5
parentc879543be97e2d851430db3f17afaf9f4a1d00fa
Fix bug where a % in a serialized array can lead to the data being broken

It turns out that is a field in a serialized array has a %2 (for example) this gets swapped in executeQuery for the
%2 value (in this case srcID - rendering the serialized array invalid. This proposes that we
explicitly handle arrays as  a data type in compose query.

Some thoughts
1) we could make serialized arrays valid types in validate (not done here)
2) we could iterate through the  array keys  & values escaping them -
at this stage it's left in the calling function
3) there are whole bikeshed factories to keep in business on discussion of whether
'Array-1', 'Array-2' etc are the right format
CRM/Dedupe/Finder.php
CRM/Dedupe/Merger.php
tests/phpunit/api/v3/JobTest.php