@@ -121,13 +121,11 @@ protected function addOptionsFromString(string $searchString): void
121121 foreach ($ patterns as $ termType => $ pattern ) {
122122 $ matches = [];
123123 preg_match_all ($ pattern , $ searchString , $ matches );
124- if (count ($ matches ) > 0 ) {
125- foreach ($ matches [1 ] as $ index => $ value ) {
126- $ negated = str_starts_with ($ matches [0 ][$ index ], '- ' );
127- $ terms [$ termType ][] = $ constructors [$ termType ]($ value , $ negated );
128- }
129- $ searchString = preg_replace ($ pattern , '' , $ searchString );
124+ foreach ($ matches [1 ] as $ index => $ value ) {
125+ $ negated = str_starts_with ($ matches [0 ][$ index ], '- ' );
126+ $ terms [$ termType ][] = $ constructors [$ termType ]($ value , $ negated );
130127 }
128+ $ searchString = preg_replace ($ pattern , '' , $ searchString );
131129 }
132130
133131 // Unescape exacts and backslash escapes
@@ -261,7 +259,7 @@ public function getAdditionalOptionsString(): string
261259 $ userFilters = ['updated_by ' , 'created_by ' , 'owned_by ' ];
262260 $ unsupportedFilters = ['is_template ' , 'sort_by ' ];
263261 foreach ($ this ->filters ->all () as $ filter ) {
264- if (in_array ($ filter ->getKey (), $ userFilters , true ) && $ filter ->value !== null && $ filter ->value !== 'me ' ) {
262+ if (in_array ($ filter ->getKey (), $ userFilters , true ) && $ filter ->value && $ filter ->value !== 'me ' ) {
265263 $ options [] = $ filter ;
266264 } else if (in_array ($ filter ->getKey (), $ unsupportedFilters , true )) {
267265 $ options [] = $ filter ;
0 commit comments