Skip to content

Commit

Permalink
Strip pci. prefix from citation searches.
Browse files Browse the repository at this point in the history
This does not affect functionality but is now done for correctness.
  • Loading branch information
EreMaijala committed Jan 22, 2025
1 parent 43b35a0 commit 5379b1c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ protected function performSearch($terms, $args)
{
$terms = $this->convertContainsOps($terms);

// Strip 'pci.' prefix from citation searches:
if (array_intersect(['citedby', 'citing'], array_column($args['filterList'] ?? [], 'field'))) {
if (str_starts_with($terms[0]['lookfor'] ?? '', '"pci.')) {
$terms[0]['lookfor'] = '"' . substr($terms[0]['lookfor'], 5);
}
}

foreach ($this->hiddenFilters as $filter => $value) {
if ($filter == 'pcAvailability') {
// Toggle the setting unless we are told to ignore the hidden filter:
Expand Down

0 comments on commit 5379b1c

Please sign in to comment.