We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -365,8 +365,8 @@ |
||
| 365 | 365 | $searchResult['snippet'] = $doc['snippet']; |
| 366 | 366 | $searchResult['highlight'] = $doc['highlight']; |
| 367 | 367 | $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
| 368 | - preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 369 | - preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
|
| 368 | + preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 369 | + preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
|
| 370 | 370 | } |
| 371 | 371 | $documents[$doc['uid']]['searchResults'][] = $searchResult; |
| 372 | 372 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | // Add filter query for date search |
| 213 | 213 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
| 214 | 214 | // combine dateFrom and dateTo into range search |
| 215 | - $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}'. $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
| 215 | + $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | // Add filter query for faceting. |
@@ -243,16 +243,16 @@ discard block |
||
| 243 | 243 | $virtualCollectionsQueryString = ''; |
| 244 | 244 | foreach ($this->collection as $collectionEntry) { |
| 245 | 245 | // check for virtual collections query string |
| 246 | - if($collectionEntry->getIndexSearch()) { |
|
| 247 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR ('. $collectionEntry->getIndexSearch() . ')' ; |
|
| 246 | + if ($collectionEntry->getIndexSearch()) { |
|
| 247 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')'; |
|
| 248 | 248 | } else { |
| 249 | 249 | $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"'; |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | // distinguish between simple collection browsing and actual searching within the collection(s) |
| 254 | - if(!empty($collectionsQueryString)) { |
|
| 255 | - if(empty($query)) { |
|
| 254 | + if (!empty($collectionsQueryString)) { |
|
| 255 | + if (empty($query)) { |
|
| 256 | 256 | $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
| 257 | 257 | } else { |
| 258 | 258 | $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separatly |
| 263 | - if(!empty($virtualCollectionsQueryString)) { |
|
| 263 | + if (!empty($virtualCollectionsQueryString)) { |
|
| 264 | 264 | $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
| 265 | 265 | } |
| 266 | 266 | |
@@ -339,8 +339,8 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | if ($documents[$doc['uid']]) { |
| 341 | 341 | // translate language code if applicable |
| 342 | - if($doc['metadata']['language']) { |
|
| 343 | - foreach($doc['metadata']['language'] as $indexName => $language) { |
|
| 342 | + if ($doc['metadata']['language']) { |
|
| 343 | + foreach ($doc['metadata']['language'] as $indexName => $language) { |
|
| 344 | 344 | $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]); |
| 345 | 345 | } |
| 346 | 346 | } |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | if ($this->searchParams['fulltext'] == '1') { |
| 365 | 365 | $searchResult['snippet'] = $doc['snippet']; |
| 366 | 366 | $searchResult['highlight'] = $doc['highlight']; |
| 367 | - $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
| 368 | - preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 367 | + $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
| 368 | + preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 369 | 369 | preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
| 370 | 370 | } |
| 371 | 371 | $documents[$doc['uid']]['searchResults'][] = $searchResult; |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | foreach ($result['documents'] as $doc) { |
| 444 | 444 | // translate language code if applicable |
| 445 | - if($doc['metadata']['language']) { |
|
| 446 | - foreach($doc['metadata']['language'] as $indexName => $language) { |
|
| 445 | + if ($doc['metadata']['language']) { |
|
| 446 | + foreach ($doc['metadata']['language'] as $indexName => $language) { |
|
| 447 | 447 | $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]); |
| 448 | 448 | } |
| 449 | 449 | } |