Postgres driver setSchema

Hi, I’m working in a project using postgres which uses several different schemas not named according to CakePHP standards. When calling the setSchema function in vendor/cakephp/cakephp/src/Database/Driver/Postgres.php, I need to comment out $this->_connection->quote($schema) when settings the search_path to make it work. Is there a way to avoid this by setting a flag somewhere, change schema definition in config or something?

public function setSchema($schema)
{
    $this->connect();
    //$this->_connection->exec('SET search_path TO ' . $this->_connection->quote($schema));
    $this->_connection->exec('SET search_path TO ' . $schema);
}