Fix #15363 - Remove unexpected quotes on text fields

Fixes: #15363
Pull-request: #15409

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2019-08-20 09:59:30 +02:00
commit 6f14206810
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
3 changed files with 13 additions and 0 deletions

View File

@ -371,6 +371,12 @@ class TableStructureController extends TableController
$this->db, $this->table, null, true
);
foreach ($fields as $key => $row) {
if ('text' === substr($row['Type'], -4)) {
$fields[$key]['Default'] = stripcslashes(substr($row['Default'], 1, -1));
}
}
//display table structure
$this->response->addHTML(
$this->displayStructure(

View File

@ -2077,6 +2077,8 @@ class InsertEdit
$special_chars = Util::addMicroseconds($column['Default']);
} elseif ($trueType == 'binary' || $trueType == 'varbinary') {
$special_chars = bin2hex($column['Default']);
} elseif ('text' === substr($trueType, -4)) {
$special_chars = stripcslashes(substr($column['Default'], 1, -1));
} else {
$special_chars = htmlspecialchars($column['Default']);
}

View File

@ -263,6 +263,11 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
break;
default:
$columnMeta['DefaultType'] = 'USER_DEFINED';
if ('text' === substr($columnMeta['Type'], -4)) {
$columnMeta['Default'] = stripcslashes(substr($columnMeta['Default'], 1, -1));
}
$columnMeta['DefaultValue'] = $columnMeta['Default'];
break;
}