From ea5cd595c962ae29465c8f23e503868cc605b9b2 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 27 Feb 2021 11:34:48 -0500 Subject: Remove + conversion in search except for tags (#3489) Before, every + sign was converted to a space to allow to search for spaces. But the documentation stated that to search for space one has to enclose the string in quotes. This has a confusing behavior when searching for a string containing a + sign. Now, the + conversion is kept only for the tag search since it's the only one documented that way. See #3454 --- tests/app/Models/SearchTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php index 22070351c..357f91acd 100644 --- a/tests/app/Models/SearchTest.php +++ b/tests/app/Models/SearchTest.php @@ -66,6 +66,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('intitle:"word1 word2\' word3"', array("word1 word2' word3"), null), array("intitle:'word1 word2\" word3'", array('word1 word2" word3'), null), array("intitle:word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['intitle:word1+word2', ['word1+word2'], null], ); } @@ -102,6 +103,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('author:"word1 word2\' word3"', array("word1 word2' word3"), null), array("author:'word1 word2\" word3'", array('word1 word2" word3'), null), array("author:word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['author:word1+word2', ['word1+word2'], null], ); } @@ -129,6 +131,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('inurl:"word1 word2"', array('"word1'), array('word2"')), array('inurl:word1 word2 inurl:word3', array('word1', 'word3'), array('word2')), array("inurl:word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['inurl:word1+word2', ['word1+word2'], null], ); } @@ -208,6 +211,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('#"word1 word2"', array('"word1'), array('word2"')), array('#word1 #word2', array('word1', 'word2'), null), array("#word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['#word1+word2', ['word1 word2'], null], ); } @@ -290,5 +294,4 @@ class SearchTest extends PHPUnit\Framework\TestCase { ), ); } - } -- cgit v1.2.3