You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PHP: hash in SQL string breaks syntax highlighting #48096
confirmedIssue has been confirmed by VS Code Team memberphpPHP support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
class test2 {
publicfunctionmethod1($txt)
{
$q = "SELECT b2.* FROM (SELECT users ORDER BY id DESC) as b2";
return$this->query($q);
}
publicfunctionmethod2()
{
returntrue;
}
}
I have a similar issue while checking for SQL injection segments.
"SELECT /*!" is in an array, and the syntax highlighting is all green (comments) after it, even though it's within quotes. If I make it a lower case select, then it fixes itself
Alternatively, if I put /* ? */ after it, everything changes to that burnt orange colour (string?)
Interestingly, "SELECT USER()", "SELECT SUBSTRING(user_password", "' or 1=1/*" and ["/*! MYSQL Special SQL *" don't bring about the same outcome.
This only happens for me when the string begins with syntax which is interpreted as being part of an SQL query (e.g. "AND"), there is a variable concatenated between two double-quoted strings each containing one single-quote, and the variable outside of the string has two levels of encapsulation.
In the screenshot, "->value" is the wrong color, as are the two concatenation periods on either side of the variable expression.
confirmedIssue has been confirmed by VS Code Team memberphpPHP support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
Activity
vscodebot commentedon Apr 18, 2018
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
neerolyte commentedon Apr 18, 2018
This is a different syntax problem.
roblourens commentedon Apr 18, 2018
Upstream: atom/language-php#327
sergiolch commentedon Jul 16, 2019
I also have a similar issue with SQL:
but it looks like this:
MikeTodd commentedon Sep 12, 2019
I noticed a similar bug: #80810
Note that this only happens when SELECT is in all caps, and you're using a single-quote within the string.
misterHippo commentedon Nov 8, 2019
I have a similar issue while checking for SQL injection segments.
"SELECT /*!"is in an array, and the syntax highlighting is all green (comments) after it, even though it's within quotes. If I make it a lower caseselect, then it fixes itselfAlternatively, if I put /* ? */ after it, everything changes to that burnt orange colour (string?)
Interestingly,
"SELECT USER()","SELECT SUBSTRING(user_password","' or 1=1/*"and["/*! MYSQL Special SQL *"don't bring about the same outcome.Blurazzle commentedon Nov 21, 2019
I have a similar problem. This database has column names with a #. These columns break the syntax highlighting.

DABugh commentedon Oct 27, 2020
Similar (PHP):
This only happens for me when the string begins with syntax which is interpreted as being part of an SQL query (e.g. "AND"), there is a variable concatenated between two double-quoted strings each containing one single-quote, and the variable outside of the string has two levels of encapsulation.
In the screenshot, "->value" is the wrong color, as are the two concatenation periods on either side of the variable expression.
roblourens commentedon Dec 13, 2022
Since the upstream project has been archived, merging this into the general issue for a new SSH grammar. #162707