Skip to content

Commit

Permalink
Fixes a couple of places where search APIs were using obsolete globals
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Mar 28, 2024
1 parent 176f111 commit 69d669f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions Sources/Search/APIs/Custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ public function isValid(): bool
*/
public function searchSort(string $a, string $b): int
{
global $excludedWords;

$x = strlen($a) - (in_array($a, $excludedWords) ? 1000 : 0);
$y = strlen($b) - (in_array($b, $excludedWords) ? 1000 : 0);
$x = strlen($a) - (in_array($a, $this->excludedWords) ? 1000 : 0);
$y = strlen($b) - (in_array($b, $this->excludedWords) ? 1000 : 0);

return $y < $x ? 1 : ($y > $x ? -1 : 0);
}
Expand Down
6 changes: 2 additions & 4 deletions Sources/Search/APIs/Fulltext.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ protected function _getMinWordLength(): int
*/
public function searchSort(string $a, string $b): int
{
global $excludedWords;

$x = Utils::entityStrlen($a) - (in_array($a, $excludedWords) ? 1000 : 0);
$y = Utils::entityStrlen($b) - (in_array($b, $excludedWords) ? 1000 : 0);
$x = Utils::entityStrlen($a) - (in_array($a, $this->excludedWords) ? 1000 : 0);
$y = Utils::entityStrlen($b) - (in_array($b, $this->excludedWords) ? 1000 : 0);

return $x < $y ? 1 : ($x > $y ? -1 : 0);
}
Expand Down

0 comments on commit 69d669f

Please sign in to comment.