Skip to content

Commit

Permalink
Merge pull request #154 from AleksSem/master
Browse files Browse the repository at this point in the history
add fix to skip ' with trailing slash
  • Loading branch information
oscarotero committed Jul 27, 2017
2 parents 010d440 + a5638b7 commit 6c27656
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Utils/JsFunctionsScanner.php
Expand Up @@ -35,6 +35,13 @@ public function getFunctions(array $constants = [])
$next = isset($this->code[$pos + 1]) ? $this->code[$pos + 1] : null;

switch ($char) {
case '\\':
$prev = $char;
$char = $next;
$pos++;
$next = isset($this->code[$pos]) ? $this->code[$pos] : null;
break;

case "\n":
++$line;

Expand Down Expand Up @@ -224,12 +231,6 @@ protected function upStatus()
protected static function prepareArgument($argument)
{
if ($argument && ($argument[0] === '"' || $argument[0] === "'")) {
if ($argument[0] === '"') {
$argument = str_replace('\\"', '"', $argument);
} else {
$argument = str_replace("\\'", "'", $argument);
}

return substr($argument, 1, -1);
}
}
Expand Down

0 comments on commit 6c27656

Please sign in to comment.