mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Escape table name in versioned to allow creation of page type classes with the same names as SQL reserved words
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@68170 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6f30d987f3
commit
b26bd547ba
@ -265,7 +265,7 @@ class Versioned extends DataObjectDecorator {
|
||||
|
||||
if(!isset($manipulation[$table]['fields']['Version'])) {
|
||||
// Add any extra, unchanged fields to the version record.
|
||||
$data = DB::query("SELECT * FROM $table WHERE ID = $id")->record();
|
||||
$data = DB::query("SELECT * FROM `$table` WHERE ID = $id")->record();
|
||||
if($data) foreach($data as $k => $v) {
|
||||
if (!isset($newManipulation['fields'][$k])) $newManipulation['fields'][$k] = "'" . addslashes($v) . "'";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user