Skip to content

Commit

Permalink
Remove workaround in PDO\SQLSrv\Connection::quote()
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Jul 25, 2020
1 parent 824d2eb commit 95191ee
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/Driver/PDO/SQLSrv/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
use Doctrine\DBAL\ParameterType;
use PDO;

use function is_string;
use function strpos;
use function substr;

final class Connection implements ServerInfoAwareConnection
{
/** @var PDOConnection */
Expand Down Expand Up @@ -40,14 +36,7 @@ public function query(string $sql): Result
*/
public function quote($value, $type = ParameterType::STRING)
{
$val = $this->connection->quote($value, $type);

// Fix for a driver version terminating all values with null byte
if (is_string($val) && strpos($val, "\0") !== false) {
$val = substr($val, 0, -1);
}

return $val;
return $this->connection->quote($value, $type);
}

public function exec(string $sql): int
Expand Down

0 comments on commit 95191ee

Please sign in to comment.