BUGFIX Escaping $locale values in Translatable->augmentSQL() in addition to the i18n::validate_locale() input validation (from r114515) (from r114516)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@114517 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-12-05 05:30:37 +00:00 committed by Sam Minnee
parent 51e55681f4
commit bed7d8cee6

View File

@ -475,7 +475,7 @@ class Translatable extends DataObjectDecorator {
&& !preg_match('/("|\')Lang("|\')/', $query->getFilter()) && !preg_match('/("|\')Lang("|\')/', $query->getFilter())
//&& !$query->filtersOnFK() //&& !$query->filtersOnFK()
) { ) {
$qry = sprintf('`%s`.`Locale` = \'%s\'', $baseTable, $locale); $qry = sprintf('`%s`.`Locale` = \'%s\'', $baseTable, Convert::raw2sql($locale));
$query->where[] = $qry; $query->where[] = $qry;
} }
} }