mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Ensure that enum values with a single quote are escaped correctly for PHP coming out of MySQL ('' to \'), otherwise dev/build shows these as changed all the time.
This commit is contained in:
parent
b4fb174809
commit
13be7cb2b9
@ -367,7 +367,9 @@ class MySQLDatabase extends SS_Database {
|
|||||||
public function fieldList($table) {
|
public function fieldList($table) {
|
||||||
$fields = DB::query("SHOW FULL FIELDS IN \"$table\"");
|
$fields = DB::query("SHOW FULL FIELDS IN \"$table\"");
|
||||||
foreach($fields as $field) {
|
foreach($fields as $field) {
|
||||||
$fieldSpec = $field['Type'];
|
|
||||||
|
// ensure that '' is converted to \' in field specification (mostly for the benefit of ENUM values)
|
||||||
|
$fieldSpec = str_replace('\'\'', '\\\'', $field['Type']);
|
||||||
if(!$field['Null'] || $field['Null'] == 'NO') {
|
if(!$field['Null'] || $field['Null'] == 'NO') {
|
||||||
$fieldSpec .= ' not null';
|
$fieldSpec .= ' not null';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user