? Success

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
15 Aug 2017

Summary of Changes

Fix getString call to the post data

Testing Instructions

review

Expected result

getString just accepts two parameters see: https://api.joomla.org/cms-3/classes/JInput.html#method_getString

Actual result

getString is called with three parameters

Documentation Changes Required

none

Reporter to the JSST

@sandewt

avatar joomla-cms-bot joomla-cms-bot - change - 15 Aug 2017
Category Front End com_search
avatar zero-24 zero-24 - open - 15 Aug 2017
avatar zero-24 zero-24 - change - 15 Aug 2017
Status New Pending
avatar zero-24 zero-24 - change - 15 Aug 2017
Labels Added: ?
avatar zero-24
zero-24 - comment - 15 Aug 2017

I have not noticed them before. Done with the last commit thanks @wilsonge

avatar zero-24 zero-24 - change - 15 Aug 2017
The description was changed
avatar zero-24 zero-24 - edited - 15 Aug 2017
avatar sandewt
sandewt - comment - 20 Aug 2017

In the class Jinput the default = null;

  • getWord($name, $default = null)
  • getUint($name, $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?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17546.

avatar sandewt
sandewt - comment - 20 Aug 2017

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?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17546.

avatar zero-24
zero-24 - comment - 21 Aug 2017

done

avatar mbabker mbabker - change - 15 Sep 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-09-15 18:57:03
Closed_By mbabker
avatar mbabker mbabker - close - 15 Sep 2017
avatar mbabker mbabker - merge - 15 Sep 2017

Add a Comment

Login with GitHub to post a comment