Jump to content

[BUG 4.7.11] Search filter 'minimum reviews' not fully updated to cast values as integers


teraßyte
Go to solution Solved by Marc,

Recommended Posts

In the recent 4.7.11 update, I've noticed you updated the search filters code in \applications\core\modules\front\search\search.php to cast the variables as (int) types:

				if ( isset( \IPS\Request::i()->search_min_replies ) AND isset( $class::$commentClass ) )
				{
					$filter->minimumComments( (int) \IPS\Request::i()->search_min_replies + 1 );
					$baseUrl = $baseUrl->setQueryString( 'search_min_replies', (int) \IPS\Request::i()->search_min_replies );
					$titleConditions[] = \IPS\Member::loggedIn()->language()->addToStack( 'search_blurb_min_replies', FALSE, [ 'sprintf' => [ (int) \IPS\Request::i()->search_min_replies ] ] );
				}

Note how there are 3 values cast as (int) in the code above.

 

However, in the code for minimum reviews on line 514, the $baseUrl line wasn't updated:

				if ( isset( \IPS\Request::i()->search_min_reviews ) AND isset( $class::$reviewClass ) )
				{
					$filter->minimumReviews( (int) \IPS\Request::i()->search_min_reviews );
					$baseUrl = $baseUrl->setQueryString( 'search_min_reviews', \IPS\Request::i()->search_min_reviews );
					$titleConditions[] = \IPS\Member::loggedIn()->language()->addToStack( 'search_blurb_min_reviews', FALSE, [ 'sprintf' => [ (int) \IPS\Request::i()->search_min_reviews ] ] );
				}

For consistency, it should be:

					$baseUrl = $baseUrl->setQueryString( 'search_min_reviews', (int) \IPS\Request::i()->search_min_reviews );
Link to comment
Share on other sites

Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.

 

Link to comment
Share on other sites

  • 1 month later...
  • Solution

This issue was resolved in our recent 4.7.12 release of the platform. Please upgrade to this version to resolve the bug, and if you experience any further issues with this, please let us know.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...