Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX Ensure that enum values with a single quote are escaped correc…

…tly for PHP coming out of MySQL ('' to \'), otherwise dev/build shows these as changed all the time.
  • Loading branch information...
commit 13be7cb2b98453efae2952b4879bfd557806b702 1 parent b4fb174
@halkyon halkyon authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 model/MySQLDatabase.php
View
4 model/MySQLDatabase.php
@@ -367,7 +367,9 @@ public function renameField($tableName, $oldName, $newName) {
public function fieldList($table) {
$fields = DB::query("SHOW FULL FIELDS IN \"$table\"");
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') {
$fieldSpec .= ' not null';
}
Please sign in to comment.
Something went wrong with that request. Please try again.