New issue 14 by chrismar...@gmail.com: cleanRequestData modifies arguments
causing a set call to not work as required
http://code.google.com/p/php-transmission-class/issues/detail?id=14
What steps will reproduce the problem?
1. Call the set function with multiple "files-wanted" values, such as
$arguments[ 'files-wanted' ] = array( 0,1,2,3,4 );
2. Dump the evaluated value of "json_encode( $arguments );" before the call
to cleanRequestData in the request function, and again afterwards to see
the effect its having.
File Id 0 ends up being dropped from the arguments, whilst all other
numbers now have an associated key, which Transmission doesn't seem to like
and ignores all values. Also makes File Id 0 impossible to set.
What is the expected output? What do you see instead?
I expect: "files-wanted":[0,1,2,3,4]
I get : "files-wanted":{"1":1,"2":2,"3":3,"4":4}
What version of the product are you using? On what operating system?
v0.3, Windows 7, PHP v5.2.17
Please provide any additional information below.
Its the same with a set request for "files-unwanted".
Single Ids on their own aren't affected, except for specifying an Id of 0,
which as a result of being stripped out leaves the id list empty and as per
the spec, means all files will be marked as wanted/unwanted instead.
Commenting out the call to cleanRequestData gets the result I expect, but
breaks other functionality.