statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Search (comb) throws exception if search term starts with plus (+) or minus (-) sign #2348

Closed pxmch closed 5 years ago

pxmch commented 5 years ago

Describe the bug If a search term starts with a plus (+) or a minus (-) sign, comb throws the following exception: ErrorException in Comb.php line 714: Array to string conversion

To Reproduce

  1. Set up a search form with this code:
    <form method="get" action="/varia/search" id="search-form">
    <input id="site-search" type="text" value="" class="search-query" name="q">
    <input type="submit" value="Suche" name="Suche" class="btn-search">
    </form>
  2. Enter one of the following search terms: +term1 or -term1 or term1 +term2 or term1 -term2
  3. Submit the form.

Expected behavior The search should return some or no results but not throw an exception

Screenshots

grafik

Environment details (please complete the following information):