diff --git a/ChangeLog b/ChangeLog index de5c0bab6a..cfda035740 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,7 @@ phpMyAdmin - ChangeLog - issue #11541 Missing arguments for PMA_Table::generateAlter() - issue #11544 Notices about undefined indexes on structure pages of information_schema tables - issue Change minimum PHP version for Composer +- issue #11542 Import parser and backslash 4.5.0.2 (2015-09-25) - issue #11497 Incorrect indexes when exporting diff --git a/libraries/sql-parser/src/Utils/BufferedQuery.php b/libraries/sql-parser/src/Utils/BufferedQuery.php index 1da0b81dfe..7a2e5f4374 100644 --- a/libraries/sql-parser/src/Utils/BufferedQuery.php +++ b/libraries/sql-parser/src/Utils/BufferedQuery.php @@ -186,19 +186,31 @@ class BufferedQuery $loopLen = $end ? $len : $len - 16; for (; $i < $loopLen; ++$i) { + /** + * Handling backslash. + * + * Even if the next character is a special character that should be + * treated differently, because of the preceding backslash, it will + * be ignored. + */ + if ($this->query[$i] === '\\') { + $this->current .= $this->query[$i] . $this->query[++$i]; + continue; + } + /* * Handling special parses statuses. */ if ($this->status === static::STATUS_STRING_SINGLE_QUOTES) { // Single-quoted strings like 'foo'. - if (($this->query[$i - 1] != '\\') && ($this->query[$i] === '\'')) { + if ($this->query[$i] === '\'') { $this->status = 0; } $this->current .= $this->query[$i]; continue; } elseif ($this->status === static::STATUS_STRING_DOUBLE_QUOTES) { // Double-quoted strings like "bar". - if (($this->query[$i - 1] != '\\') && ($this->query[$i] === '"')) { + if ($this->query[$i] === '"') { $this->status = 0; } $this->current .= $this->query[$i];