Parse commentsd
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@212 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
38cb78af60
commit
49c3007eea
|
@ -16,9 +16,10 @@ if ($_POST && $error) {
|
||||||
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
|
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
|
||||||
$delimiter = preg_quote($match[1], '~');
|
$delimiter = preg_quote($match[1], '~');
|
||||||
$query = substr($query, strlen($match[0]));
|
$query = substr($query, strlen($match[0]));
|
||||||
} elseif (preg_match("~$delimiter|['`\"]|\$~", $query, $match, PREG_OFFSET_CAPTURE, $offset)) {
|
} elseif (preg_match("~$delimiter|['`\"]|/\\*|-- |\$~", $query, $match, PREG_OFFSET_CAPTURE, $offset)) {
|
||||||
if ($match[0][0] && $match[0][0] != $delimiter) {
|
if ($match[0][0] && $match[0][0] != $delimiter) {
|
||||||
preg_match('~\\G([^\\\\' . $match[0][0] . ']+|\\\\.)*(' . $match[0][0] . '|$)~s', $query, $match, PREG_OFFSET_CAPTURE, $match[0][1] + 1);
|
$pattern = ($match[0][0] == "-- " ? '~.*~' : ($match[0][0] == "/*" ? '~.*\\*/~sU' : '~\\G([^\\\\' . $match[0][0] . ']+|\\\\.)*(' . $match[0][0] . '|$)~s'));
|
||||||
|
preg_match($pattern, $query, $match, PREG_OFFSET_CAPTURE, $match[0][1] + 1);
|
||||||
$offset = $match[0][1] + strlen($match[0][0]);
|
$offset = $match[0][1] + strlen($match[0][0]);
|
||||||
} else {
|
} else {
|
||||||
$empty = false;
|
$empty = false;
|
||||||
|
|
Loading…
Reference in a new issue