]> BookStack Code Mirror - bookstack/commitdiff
Fixed empty search scenario
authorDan Brown <redacted>
Sat, 27 Jun 2020 12:37:18 +0000 (13:37 +0100)
committerDan Brown <redacted>
Sat, 27 Jun 2020 12:37:18 +0000 (13:37 +0100)
app/Entities/SearchOptions.php

index af9156953e6bf98f732a23c0e91b432e1adc33ee..a121bd7939cbc6eb4e6ccd18e96e21dcf1e7f992 100644 (file)
@@ -45,6 +45,10 @@ class SearchOptions
      */
     public static function fromRequest(Request $request): SearchOptions
     {
+        if (!$request->has('search') && !$request->has('term')) {
+            return static::fromString('');
+        }
+
         if ($request->has('term')) {
             return static::fromString($request->get('term'));
         }