mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Update RelatedDataService to properly escape ClassName in Polymorphic relations (#10713)
This commit is contained in:
parent
94b24b2390
commit
403f924d22
@ -394,14 +394,7 @@ class StandardRelatedDataService implements RelatedDataService
|
||||
*/
|
||||
private function prepareClassNameLiteral(string $value): string
|
||||
{
|
||||
$c = chr(92);
|
||||
$escaped = str_replace($c ?? '', "{$c}{$c}", $value ?? '');
|
||||
// postgres
|
||||
if (stripos(get_class(DB::get_conn()), 'postgres') !== false) {
|
||||
return "E'{$escaped}'";
|
||||
}
|
||||
// mysql
|
||||
return "'{$escaped}'";
|
||||
return DB::get_conn()->quoteString($value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user