Ensure parameters used by API methods are read from both GET and POST #3506
Labels
Task
Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone
filter_limit is ignored and the default is used when searching with Live.getLastVisitsDetails via POST (and POST is listed as valid method in the API documentation http://piwik.org/docs/analytics-api/reference/ ).
the problem is only GET parameters are checked here:
/plugins/API/Controller.php
array concatenation with + does not seem to work the way it did during the olden times (keys from the array on the right replacing keys in the array on the left, the way it was explained in the old "PHP Cookbook" by David Sklar and Adam Trachtenberg, for example), but the keys from the array on the right are ignored if the key exists in the array on the left, which you can test with this simple script:
so in /core/API/Request.php, in function getRequestArrayFromString, this line
does not work as hoped, and the value that was set to the default in $_GET stays the default.
problem present at least in 1.8.3 and 1.9.1
tested with PHP 5.3.2-1ubuntu4.18 with Suhosin-Patch (cli) (built: Sep 12 2012 19:12:47) on Ubuntu 10.04.4 LTS.
Keywords: filter_limit
The text was updated successfully, but these errors were encountered: