This commit is contained in:
Laurent Destailleur 2020-10-07 17:17:13 +02:00
parent 24295b309d
commit 561ca757d7

View File

@ -2387,6 +2387,7 @@ function price2fec($amount)
/** /**
* Check the syntax of some PHP code. * Check the syntax of some PHP code.
*
* @param string $code PHP code to check. * @param string $code PHP code to check.
* @return boolean|array If false, then check was successful, otherwise an array(message,line) of errors is returned. * @return boolean|array If false, then check was successful, otherwise an array(message,line) of errors is returned.
*/ */
@ -2408,12 +2409,14 @@ function phpSyntaxError($code)
} }
} elseif ($inString & 1) { } elseif ($inString & 1) {
switch ($token) { switch ($token) {
case '`': case '\'': case '`':
case '\'':
case '"': --$inString; break; case '"': --$inString; break;
} }
} else { } else {
switch ($token) { switch ($token) {
case '`': case '\'': case '`':
case '\'':
case '"': ++$inString; break; case '"': ++$inString; break;
case '{': ++$braces; break; case '{': ++$braces; break;
case '}': case '}':
@ -2455,4 +2458,3 @@ function phpSyntaxError($code)
@ini_set('log_errors', $inString); @ini_set('log_errors', $inString);
return $code; return $code;
} }