User tests: Successful: Unsuccessful:
Fix getString call to the post data
review
getString just accepts two parameters see: https://api.joomla.org/cms-3/classes/JInput.html#method_getString
getString is called with three parameters
none
Category | ⇒ | Front End com_search |
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
In the class Jinput the default = null;
So I think:
$post['ordering'] = $this->input->post->getWord('ordering', null);
$post['limit'] = $this->input->post->getUInt('limit', null);
Could be:
$post['ordering'] = $this->input->post->getWord('ordering');
$post['limit'] = $this->input->post->getUInt('limit');
Tested: search for 'joomla'
$post['ordering'] = $this->input->post->getWord('');
$post['searchphrase'] = $this->input->post->getWord('searchphrase', 'all');
$post['limit'] = $this->input->post->getUInt('');
echo '<pre>';
var_dump($post);
echo '</pre>';
die;
Result:
array(4) {
["searchword"]=>
string(6) "joomla"
["ordering"]=>
NULL
["searchphrase"]=>
string(3) "all"
["limit"]=>
NULL
}
Or I be wrong?
The same issue is of course for line 48:
$searchword = trim(str_replace($badchars, '', $this->input->post->getString('searchword', null)));
$searchword = trim(str_replace($badchars, '', $this->input->post->getString('searchword'))); // ???
It is something confusing, because you can use another option:
$searchword = trim(str_replace($badchars, '', $this->input->get('searchword', null, post)));
What is wisdom?
done
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-15 18:57:03 |
Closed_By | ⇒ | mbabker |
We should fix this in the other places in the file https://github.com/zero-24/joomla-cms/blob/516563e529c52a1c827f6c93db408816e3b68b12/components/com_search/controller.php#L61-L63