From 1c402229bfddf4073a76fbb7da99f91beba5602d Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 7 Jun 2018 11:53:22 -0400 Subject: [PATCH] Avoid problem with proliferating quotation marks. - Resolves VUFIND-1287. --- module/VuFind/src/VuFind/Search/SolrAuthor/Params.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php b/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php index 65938234da2..72923ad6006 100644 --- a/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php +++ b/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php @@ -54,9 +54,11 @@ class Params extends \VuFind\Search\Solr\Params return false; } - // Force the search to be a phrase: - $lookfor = '"' . str_replace('"', '\"', $lookfor) . '"'; - + // Force the search to be a phrase if it is not already: + if (!preg_match('/^".*"$/', $lookfor)) { + $lookfor = '"' . str_replace('"', '\"', $lookfor) . '"'; + } + // Set the search (handler is always Author for this module): $this->setBasicSearch($lookfor, 'Author'); return true; -- GitLab