User tests: Successful: Unsuccessful:
This is a pull request for issue #6008.
It fixes the applying of wrong filters in the case, that the function is called without parameters.
If using the JInput::getArray() function without parameters e.g.
$mypostdata = $myapp->input->post->getArray();
and the post data contains variables having values matching a JInputFilter type e.g. 'integer', 'int', 'float' etc. these values will be applied as filter in the following function code:
if (is_null($datasource))
{
$results[$k] = $this->get($k, null, $v);
}
When calling the function without parameters the function uses the class property 'data', which is an associative array with variable names and their values.
So, a POST variable 'myinputstring' containing a string value 'integer' will be returned as an integer containing a 0, which is definetly a wrong behaviour.
Wouldn't it be better to detect a parameterless function call to apply 'RAW' filters in that case?
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Rel_Number | ⇒ | 6008 | |
Relation Type | ⇒ | Pull Request for |
Easy to test and the fix inconfirmed!
@test Tested and output as described.
Status | Pending | ⇒ | Ready to Commit |
RTC based on testing. Thanks!
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-04-10 15:15:49 |
@Erftralle i have just open a new PR here: #6736 That fixes the since tag. Thanks
Labels |
Removed:
?
|
Unfortunately Joomla! doesn't use the JInput::getArray() function itself. But if you like, use the following method to detect the bug quickly and to test the fix for it.
Test instructions
Please install Joomla-3.2-Hello-World-Component Step 10, create a menu item and append the following code lines to the file components/com_helloworld/views/helloworld/tmpl/default.php:
Compare the output for the variable type and value before and after applying the patch.