Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / search / src / Plugin / views / argument / Search.php
index 82afbbfe6ad2c0f6f2ec09d67af4c26f54ac9d5d..f9cd9a14b3f35ff316f6bf4a5155ac7fe4f55bbe 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Drupal\search\Plugin\views\argument;
 
+use Drupal\Core\Database\Query\Condition;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
@@ -76,7 +77,7 @@ class Search extends ArgumentPluginBase {
     else {
       $search_index = $this->ensureMyTable();
 
-      $search_condition = db_and();
+      $search_condition = new Condition('AND');
 
       // Create a new join to relate the 'search_total' table to our current 'search_index' table.
       $definition = [
@@ -96,7 +97,7 @@ class Search extends ArgumentPluginBase {
       $search_dataset = $this->query->addTable('node_search_dataset');
       $conditions = $this->searchQuery->conditions();
       $condition_conditions =& $conditions->conditions();
-      foreach ($condition_conditions  as $key => &$condition) {
+      foreach ($condition_conditions as $key => &$condition) {
         // Make sure we just look at real conditions.
         if (is_numeric($key)) {
           // Replace the conditions with the table alias of views.
@@ -109,7 +110,7 @@ class Search extends ArgumentPluginBase {
       // Add the keyword conditions, as is done in
       // SearchQuery::prepareAndNormalize(), but simplified because we are
       // only concerned with relevance ranking so we do not need to normalize.
-      $or = db_or();
+      $or = new Condition('OR');
       foreach ($words as $word) {
         $or->condition("$search_index.word", $word);
       }