1
0
mirror of synced 2024-12-13 22:56:04 +03:00

[DDC-551] Fixed the escaping of filter parameters

This commit is contained in:
Alexander 2011-07-22 14:48:20 +02:00
parent d1908f7207
commit 4cf63a4e83
2 changed files with 2 additions and 3 deletions

View File

@ -59,8 +59,7 @@ abstract class SQLFilter
throw new \InvalidArgumentException("Parameter '" . $name . "' does not exist."); throw new \InvalidArgumentException("Parameter '" . $name . "' does not exist.");
} }
// @todo: espace the parameter return $this->conn->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']);
return $this->conn->convertToDatabaseValue($this->parameters[$name]['value'], $this->parameters[$name]['type']);
} }
abstract function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias); abstract function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias);

View File

@ -144,7 +144,7 @@ class SQLFilterTest extends \Doctrine\Tests\OrmFunctionalTestCase
// Setup mock connection // Setup mock connection
$conn = $this->getMockConnection(); $conn = $this->getMockConnection();
$conn->expects($this->once()) $conn->expects($this->once())
->method('convertToDatabaseValue') ->method('quote')
->with($this->equalTo('en')) ->with($this->equalTo('en'))
->will($this->returnValue("'en'")); ->will($this->returnValue("'en'"));