ignore ; between quotes
-
in this file ajax.php
on line 10: i have replaced
$cmdArr = explode(';', $commands);with this
$cmdArr = quoted_explode($commands, $delimiters = ';');you will also need this functions
function regex_escape($subject) { return str_replace(array('\\', '^', '-', ']'), array('\\\\', '\\^', '\\-', '\\]'), $subject); } function quoted_explode($subject, $delimiters = ',', $quotes = '\'') { $clauses[] = '[^'.regex_escape($delimiters.$quotes).']'; foreach(str_split($quotes) as $quote) { $quote = regex_escape($quote); $clauses[] = "[$quote][^$quote]*[$quote]"; } $regex = '(?:'.implode('|', $clauses).')+'; preg_match_all('/'.str_replace('/', '\\/', $regex).'/', $subject, $matches); return $matches[0]; }
The topic ‘ignore ; between quotes’ is closed to new replies.