Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions libraries/joomla/language/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,20 +577,18 @@ public function setLowerLimitSearchWordCallback($function)
/**
* Returns an upper limit integer for length of search words
*
* @return integer The upper limit integer for length of search words (20 if no value was set for a specific language).
* @return integer The upper limit integer for length of search words (200 if no value was set or if default value is < 200).
*
* @since 11.1
*/
public function getUpperLimitSearchWord()
{
if ($this->upperLimitSearchWordCallback !== null)
if ($this->upperLimitSearchWordCallback !== null && call_user_func($this->upperLimitSearchWordCallback) > 200)
{
return call_user_func($this->upperLimitSearchWordCallback);
}
else
{
return 20;
}

return 200;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public function testGetUpperLimitSearchWord()
$lang = new JLanguage('');

$this->assertEquals(
20,
200,
$lang->getUpperLimitSearchWord(),
'Line: ' . __LINE__
);
Expand Down