Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / search / src / SearchQuery.php
index 7c4e07e2074bd8199daedee4e97796582031de49..fca2b23b76f30c4c10d3c3113667c24e32546203 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Drupal\search;
 
+use Drupal\Core\Database\Query\Condition;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Database\Query\SelectExtender;
 use Drupal\Core\Database\Query\SelectInterface;
@@ -205,7 +206,7 @@ class SearchQuery extends SelectExtender {
     $this->addTag('search_' . $type);
 
     // Initialize conditions and status.
-    $this->conditions = db_and();
+    $this->conditions = new Condition('AND');
     $this->status = 0;
 
     return $this;
@@ -313,7 +314,7 @@ class SearchQuery extends SelectExtender {
         }
         $has_or = TRUE;
         $has_new_scores = FALSE;
-        $queryor = db_or();
+        $queryor = new Condition('OR');
         foreach ($key as $or) {
           list($num_new_scores) = $this->parseWord($or);
           $has_new_scores |= $num_new_scores;
@@ -401,7 +402,7 @@ class SearchQuery extends SelectExtender {
     }
 
     // Build the basic search query: match the entered keywords.
-    $or = db_or();
+    $or = new Condition('OR');
     foreach ($this->words as $word) {
       $or->condition('i.word', $word);
     }
@@ -570,10 +571,9 @@ class SearchQuery extends SelectExtender {
       }
     }
 
-
     // Add arguments for the keyword relevance normalization number.
     $normalization = 1.0 / $this->normalize;
-    for ($i = 0; $i < $this->relevance_count; $i++ ) {
+    for ($i = 0; $i < $this->relevance_count; $i++) {
       $this->scoresArguments[':normalization_' . $i] = $normalization;
     }