The data being passed through by the AJAX script is (for example):
If i print out the whole $_POST so you can see the data coming through on the script side:
Array ( [action] => download_report [params] => Array ( [report] => CP [btn] => gt_run_report [params] => Array (  => Array ( [name] => categories [value] => Array (  => 5 ) )  => Array ( [name] => structureID [value] => 5 )  => Array ( [name] => extraAwardNames ) ) ) )
The optional param is being done as:
$params = optional_param_array('params', false, PARAM_TEXT);
$action = optional_param('action', false, PARAM_TEXT);
If I were to remove the params['params'] array from the data being passed through then this would work fine, as optional_param_array seems to loop through each element in the array and run clean_param() on it, assuming it's a string.
But with an array of arrays, like this, I get:
Coding error detected, it must be fixed by a programmer: clean_param() can not process arrays, please use clean_param_array() instead.
Is there any way to do this, using the optional_param* methods, and leaving my data intact? Or am I going to have to completely change how I am sending data through, to remove these multidimensional arrays?