mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Made search filters db agnostic
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76371 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
32ed6da54c
commit
a74c97f564
@ -25,11 +25,7 @@ class EndsWithFilter extends SearchFilter {
|
||||
*/
|
||||
public function apply(SQLQuery $query) {
|
||||
$query = $this->applyRelation($query);
|
||||
$query->where(
|
||||
$this->getDbName(),
|
||||
"RLIKE",
|
||||
sprintf("%s$",Convert::raw2sql($this->getValue()))
|
||||
);
|
||||
$query->where($this->getDbName() . " LIKE '%" . Convert::raw2sql($this->getValue()) . "'");
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
|
@ -25,11 +25,7 @@ class StartsWithFilter extends SearchFilter {
|
||||
*/
|
||||
public function apply(SQLQuery $query) {
|
||||
$query = $this->applyRelation($query);
|
||||
$query->where(sprintf(
|
||||
"LOCATE('%s', %s) = 1",
|
||||
Convert::raw2sql($this->getValue()),
|
||||
$this->getDbName()
|
||||
));
|
||||
$query->where($this->getDbName() . " LIKE '" . Convert::raw2sql($this->getValue()) . "%'");
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
|
Loading…
Reference in New Issue
Block a user