src/Bundle/Common/Bag/ValueBag.php
public function fetchEscape(string $key, \mysqli $db, string $default = ''): string
    {
        return $db->real_escape_string($this->fetch($key, $default));
    }
public function fetchEscape(string $key, \mysqli $db, string $default = ''): string
    {
        return $db->real_escape_string($this->fetch($key, $default));
    }
Use mysql escape function.

@param $key
@param \mysqli $db
@param string $default

@return string