diff --git a/core/modules/views/src/Plugin/views/display/EntityReference.php b/core/modules/views/src/Plugin/views/display/EntityReference.php
index eb5f04c..5fe3eb0 100644
--- a/core/modules/views/src/Plugin/views/display/EntityReference.php
+++ b/core/modules/views/src/Plugin/views/display/EntityReference.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\views\Plugin\views\display;
 
+use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Query\Condition;
 
 /**
@@ -127,12 +128,11 @@ public function query() {
     // Restrict the autocomplete options based on what's been typed already.
     if (isset($options['match'])) {
       $style_options = $this->getOption('style');
-      $value = db_like($options['match']);
       if ($options['match_operator'] !== '=') {
-        $value = $value . '%';
-        if ($options['match_operator'] != 'STARTS_WITH') {
-          $value = '%' . $value;
-        }
+        $value = Database::getConnection()->escapeLike($options['match']) . '%';
+      }
+      if ($options['match_operator'] !== 'STARTS_WITH') {
+        $value = '%' . Database::getConnection()->escapeLike($options['match']);
       }
 
       // Multiple search fields are OR'd together.
diff --git a/core/modules/views/src/Plugin/views/filter/Combine.php b/core/modules/views/src/Plugin/views/filter/Combine.php
index f8ea624..015db25 100644
--- a/core/modules/views/src/Plugin/views/filter/Combine.php
+++ b/core/modules/views/src/Plugin/views/filter/Combine.php
@@ -3,7 +3,6 @@
 namespace Drupal\views\Plugin\views\filter;
 
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Database\Database;
 
 /**
  * Filter handler which allows to search on multiple fields.
@@ -130,13 +129,14 @@ public function validate() {
    */
   public function opEqual($expression) {
     $placeholder = $this->placeholder();
-    $operator = $this->operator();
-    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => $this->value]);
+    $operator = $this->getConditionOperator('LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => '%' . $this->connection->escapeLike($this->value) . '%']);
   }
 
   protected function opContains($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression LIKE $placeholder", [$placeholder => '%' . db_like($this->value) . '%']);
+    $operator = $this->getConditionOperator('LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => '%' . $this->connection->escapeLike($this->value) . '%']);
   }
 
   /**
@@ -162,40 +162,45 @@ protected function opContainsWord($expression) {
     // Switch between the 'word' and 'allwords' operator.
     $type = $this->operator == 'word' ? 'OR' : 'AND';
     $group = $this->query->setWhereGroup($type);
-    $operator = Database::getConnection()->mapConditionOperator('LIKE');
-    $operator = isset($operator['operator']) ? $operator['operator'] : 'LIKE';
+    $operator = $this->getConditionOperator('LIKE');
 
     foreach ($matches as $match_key => $match) {
       $temp_placeholder = $placeholder . '_' . $match_key;
       // Clean up the user input and remove the sentence delimiters.
       $word = trim($match[2], ',?!();:-"');
-      $this->query->addWhereExpression($group, "$expression $operator $temp_placeholder", [$temp_placeholder => '%' . Database::getConnection()->escapeLike($word) . '%']);
+      $this->query->addWhereExpression($group, "$expression $operator $temp_placeholder", [$temp_placeholder => '%' . $this->connection->escapeLike($word) . '%']);
     }
   }
 
   protected function opStartsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression LIKE $placeholder", [$placeholder => db_like($this->value) . '%']);
+    $operator = $this->getConditionOperator('LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => $this->connection->escapeLike($this->value) . '%']);
+
   }
 
   protected function opNotStartsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression NOT LIKE $placeholder", [$placeholder => db_like($this->value) . '%']);
+    $operator = $this->getConditionOperator('NOT LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => $this->connection->escapeLike($this->value) . '%']);
   }
 
   protected function opEndsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression LIKE $placeholder", [$placeholder => '%' . db_like($this->value)]);
+    $operator = $this->getConditionOperator('LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => '%' . $this->connection->escapeLike($this->value)]);
   }
 
   protected function opNotEndsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression NOT LIKE $placeholder", [$placeholder => '%' . db_like($this->value)]);
+    $operator = $this->getConditionOperator('NOT LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => '%' . $this->connection->escapeLike($this->value)]);
   }
 
   protected function opNotLike($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression NOT LIKE $placeholder", [$placeholder => '%' . db_like($this->value) . '%']);
+    $operator = $this->getConditionOperator('NOT LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => '%' . $this->connection->escapeLike($this->value) . '%']);
   }
 
   protected function opRegex($expression) {
@@ -215,3 +220,4 @@ protected function opEmpty($expression) {
   }
 
 }
+
diff --git a/core/modules/views/src/Plugin/views/filter/StringFilter.php b/core/modules/views/src/Plugin/views/filter/StringFilter.php
index a9ab5a1..50150df 100644
--- a/core/modules/views/src/Plugin/views/filter/StringFilter.php
+++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
@@ -2,8 +2,10 @@
 
 namespace Drupal\views\Plugin\views\filter;
 
+use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Query\Condition;
 use Drupal\Core\Form\FormStateInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Basic textfield filter to handle string filtering commands
@@ -23,6 +25,43 @@ class StringFilter extends FilterPluginBase {
   // exposed filter options
   protected $alwaysMultiple = TRUE;
 
+  /**
+   * The database connection.
+   *
+   * @var \Drupal\Core\Database\Connection
+   */
+  protected $connection;
+
+  /**
+   * Constructs a new StringFilter object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Database\Connection $connection
+   *   The database connection.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $connection) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+
+    $this->connection = $connection;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('database')
+    );
+  }
+
   protected function defineOptions() {
     $options = parent::defineOptions();
 
@@ -236,8 +275,24 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function operator() {
-    return $this->operator == '=' ? 'LIKE' : 'NOT LIKE';
+    return $this->getConditionOperator($this->operator == '=' ? 'LIKE' : 'NOT LIKE');
+  }
+
+  /**
+   * Get specified condition operator mapping value.
+   *
+   * @param string $operator
+   *   Condition operator.
+   * @return string
+   *   Specified condition operator mapping value.
+   */
+  public function getConditionOperator($operator) {
+    $mapping = $this->connection->mapConditionOperator($operator);
+    return isset($mapping['operator']) ? $mapping['operator'] : $operator;
   }
 
   /**
@@ -262,7 +317,7 @@ public function opEqual($field) {
   }
 
   protected function opContains($field) {
-    $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value) . '%', 'LIKE');
+    $this->query->addWhere($this->options['group'], $field, '%' . $this->connection->escapeLike($this->value) . '%', 'LIKE');
   }
 
   protected function opContainsWord($field) {
@@ -284,7 +339,7 @@ protected function opContainsWord($field) {
       $words = trim($match[2], ',?!();:-');
       $words = $phrase ? [$words] : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY);
       foreach ($words as $word) {
-        $where->condition($field, '%' . db_like(trim($word, " ,!?")) . '%', 'LIKE');
+        $where->condition($field, '%' . $this->connection->escapeLike(trim($word, " ,!?")) . '%', 'LIKE');
       }
     }
 
@@ -298,23 +353,23 @@ protected function opContainsWord($field) {
   }
 
   protected function opStartsWith($field) {
-    $this->query->addWhere($this->options['group'], $field, db_like($this->value) . '%', 'LIKE');
+    $this->query->addWhere($this->options['group'], $field, $this->connection->escapeLike($this->value) . '%', 'LIKE');
   }
 
   protected function opNotStartsWith($field) {
-    $this->query->addWhere($this->options['group'], $field, db_like($this->value) . '%', 'NOT LIKE');
+    $this->query->addWhere($this->options['group'], $field, $this->connection->escapeLike($this->value) . '%', 'NOT LIKE');
   }
 
   protected function opEndsWith($field) {
-    $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value), 'LIKE');
+    $this->query->addWhere($this->options['group'], $field, '%' . $this->connection->escapeLike($this->value), 'LIKE');
   }
 
   protected function opNotEndsWith($field) {
-    $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value), 'NOT LIKE');
+    $this->query->addWhere($this->options['group'], $field, '%' . $this->connection->escapeLike($this->value), 'NOT LIKE');
   }
 
   protected function opNotLike($field) {
-    $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value) . '%', 'NOT LIKE');
+    $this->query->addWhere($this->options['group'], $field, '%' . $this->connection->escapeLike($this->value) . '%', 'NOT LIKE');
   }
 
   protected function opShorterThan($field) {
