pasanlamahewa / rutorrent

Automatically exported from code.google.com/p/rutorrent
0 stars 0 forks source link

Misuse of array_slice in httprpc by passing string #860

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install ruTorrent with httprpc plugin
2. Browse to the landing page
3. Observe the error message
4. Look at trunk/plugins/httprpc/action.php:111. The php built-in array_slice 
is called with a string as the first argument.
5. Look at trunk/rutorrent/php/xmlrpc.php:172. $this->val is assigned to the 
result of array(). But then on line 198-201 a string is assigned to the same 
value. This results in the the misuse of array_slice by action.php.

What is the expected output? What do you see instead?

What environment are you using?
1. My ruTorrent version is 3.5
2. My rTorrent version is 8.9.2
3. I use web-server Hip Hop Virtual Machine on OS Ubuntu 12.04 
4. I use browser Google Chrome it version is 29 on Ubuntu 12.04

Are some errors present in the web-server log?
Yes.

Original issue reported on code.google.com by hydroge...@gmail.com on 5 Oct 2013 at 1:03

GoogleCodeExporter commented 9 years ago
Can't understand, what is you mean, sorry. 
Try to read manual, please.

http://www.php.net/manual/en/function.str-replace.php

"This function returns a string or an *array*..."

Original comment by novik65 on 5 Oct 2013 at 3:34

GoogleCodeExporter commented 9 years ago
Yes, str_replace returns a string or an array. My point is, it is returning a 
string in operation. If I do a gettype($this->val) it shows "string". The code 
in action.php is expecting an array.

Original comment by hydroge...@gmail.com on 5 Oct 2013 at 4:46

GoogleCodeExporter commented 9 years ago
Please, don't write incorrect assumptions. Provide correct error description. 
If you think that it is necessary to answer the question "Are some errors 
present in the web-server log" as "yes" or "no" - you aren't right.

Original comment by novik65 on 6 Oct 2013 at 4:52