Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanRequestData modifies arguments causing a set call to not work as required #14

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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.

Original issue reported on code.google.com by chrismar...@gmail.com on 27 May 2011 at 2:04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant