diff --git a/core/modules/views/src/Plugin/views/display/EntityReference.php b/core/modules/views/src/Plugin/views/display/EntityReference.php
index 22c8c8c..ebe5403 100644
--- a/core/modules/views/src/Plugin/views/display/EntityReference.php
+++ b/core/modules/views/src/Plugin/views/display/EntityReference.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\views\Plugin\views\display;
 
+use Drupal\Core\Database\Database;
+
 /**
  * The plugin that handles an EntityReference display.
  *
@@ -122,7 +124,7 @@ 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']) . '%';
+      $value = Database::getConnection()->escapeLike($options['match']) . '%';
       if ($options['match_operator'] != 'STARTS_WITH') {
         $value = '%' . $value;
       }
diff --git a/core/modules/views/src/Plugin/views/filter/Combine.php b/core/modules/views/src/Plugin/views/filter/Combine.php
index 1b4ab9c..6d68f86 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.
@@ -136,7 +135,8 @@ function opEqual($expression) {
 
   protected function opContains($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression LIKE $placeholder", array($placeholder => '%' . db_like($this->value) . '%'));
+    $operator = $this->getConditionOperator('LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", array($placeholder => '%' . $this->connection->escapeLike($this->value) . '%'));
   }
 
   /**
@@ -162,45 +162,50 @@ 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", array($temp_placeholder => '%' . Database::getConnection()->escapeLike($word) . '%'));
+      $this->query->addWhereExpression($group, "$expression $operator $temp_placeholder", array($temp_placeholder => '%' . $this->connection->escapeLike($word) . '%'));
     }
   }
 
   protected function opStartsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression LIKE $placeholder", array($placeholder => db_like($this->value) . '%'));
+    $operator = $this->getConditionOperator('LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", array($placeholder => $this->connection->escapeLike($this->value) . '%'));
   }
 
   protected function opNotStartsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression NOT LIKE $placeholder", array($placeholder => db_like($this->value) . '%'));
+    $operator = $this->getConditionOperator('NOT LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", array($placeholder => $this->connection->escapeLike($this->value) . '%'));
   }
 
   protected function opEndsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression LIKE $placeholder", array($placeholder => '%' . db_like($this->value)));
+    $operator = $this->getConditionOperator('LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", array($placeholder => '%' . $this->connection->escapeLike($this->value)));
   }
 
   protected function opNotEndsWith($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression NOT LIKE $placeholder", array($placeholder => '%' . db_like($this->value)));
+    $operator = $this->getConditionOperator('NOT LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", array($placeholder => '%' . $this->connection->escapeLike($this->value)));
   }
 
   protected function opNotLike($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression NOT LIKE $placeholder", array($placeholder => '%' . db_like($this->value) . '%'));
+    $operator = $this->getConditionOperator('NOT LIKE');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", array($placeholder => '%' . $this->connection->escapeLike($this->value) . '%'));
   }
 
   protected function opRegex($expression) {
     $placeholder = $this->placeholder();
-    $this->query->addWhereExpression($this->options['group'], "$expression REGEXP $placeholder", array($placeholder => $this->value));
+    $operator = $this->getConditionOperator('REGEXP');
+    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", array($placeholder => $this->value));
   }
 
   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 618b584..99ca0e6 100644
--- a/core/modules/views/src/Plugin/views/filter/StringFilter.php
+++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
@@ -3,6 +3,8 @@
 namespace Drupal\views\Plugin\views\filter;
 
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Database\Connection;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Basic textfield filter to handle string filtering commands
@@ -22,6 +24,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,7 +275,20 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
   }
 
   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;
   }
 
   /**
@@ -261,7 +313,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) {
@@ -283,7 +335,7 @@ protected function opContainsWord($field) {
       $words = trim($match[2], ',?!();:-');
       $words = $phrase ? array($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');
       }
     }
 
@@ -297,23 +349,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) {
