diff --git a/typo3/sysext/core/Classes/Database/Connection.php b/typo3/sysext/core/Classes/Database/Connection.php
index 553b7c99ed05f0acecdcbb744ca29f211732a93d..4accae5ffbcae8e9efddb268c4adac994f5c7c6c 100644
--- a/typo3/sysext/core/Classes/Database/Connection.php
+++ b/typo3/sysext/core/Classes/Database/Connection.php
@@ -187,6 +187,18 @@ class Connection extends \Doctrine\DBAL\Connection implements LoggerAwareInterfa
         return $this->quoteColumnValuePairs($input);
     }
 
+    /**
+     * Quotes like wildcards for given string value.
+     *
+     * @param string $value The value to be quoted.
+     *
+     * @return string The quoted value.
+     */
+    public function escapeLikeWildcards(string $value): string
+    {
+        return addcslashes($value, '_%');
+    }
+
     /**
      * Inserts a table row with specified data.
      *
diff --git a/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php b/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php
index ee5b2cbe97c96c412598b5092f2f73cb2bf0094a..e935bf2020e77d44bff759c2274af022b241fb82 100644
--- a/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php
+++ b/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php
@@ -975,7 +975,7 @@ class QueryBuilder
      */
     public function escapeLikeWildcards(string $value): string
     {
-        return addcslashes($value, '_%');
+        return $this->connection->escapeLikeWildcards($value);
     }
 
     /**