Write own parser so that quoting is optional (RFE #1579163).

This commit is contained in:
Michal Čihař
2006-10-18 08:10:38 +00:00
parent cefeceeff0
commit 8006c1a03e
2 changed files with 8 additions and 4 deletions

View File

@@ -8,6 +8,8 @@ $HeadURL$
2006-10-18 Michal Čihař <michal@cihar.com>
* libraries/transformations/text_plain__dateformat.inc.php, lang/*:
Support displaying in UTC (RFE #1440386).
* libraries/transformations.lib.php: Write own parser so that quoting is
optional (RFE #1579163).
2006-10-17 Marc Delisle <lem9@users.sourceforge.net>
* export.php: export nothing if no tables are selected

View File

@@ -9,11 +9,13 @@
function PMA_transformation_getOptions($string) {
$transform_options = array();
if ($string != '') {
if ($string{0} == "'" && $string{strlen($string)-1} == "'") {
$transform_options = explode('\',\'', substr($string, 1, strlen($string)-2));
/* Parse options */
for ($nextToken = strtok($string, ','); $nextToken !== false; $nextToken = strtok(',')) {
if ($nextToken{0} == '\'') {
$nextToken = $nextToken{strlen($nextToken) - 1} == '\'' ? substr($nextToken, 1, -1) : substr($nextToken, 1) . ' ' . strtok('\'');
$transform_options[] = $nextToken;
} else {
$transform_options = array(0 => $string);
$transform_options[] = $nextToken;
}
}