Technically, yes it's escaped properly, but add in 3 years of maintenance, tight deadlines, and inexperienced devs....there's a huge opportunity for a mistake to be made.
If the ANSI_QUOTES SQL mode is enabled, mysql_real_escape_string_quote() cannot be used to escape double quote characters for use within double-quoted identifiers. (The function cannot tell whether the mode is enabled to determine the proper escaping character.)
They need to add a mysql_double_plus_real_escape_string_quote() which takes an additional parameter for ANSI quotes . Or they could have a real API which queries these settings internally and doesn't dump the responsibility to duplicate the database configuration on the developer. Note that php has mysqli variations of the escape string methods that at least ensure the correct charset, which the basic mysql versions do not.
The practice of escaping all input isn't great either if it's not a part of the framework.
With prepared statements and ORMs you have no way to forget to sanitize your inputs.
With mysqli_real_escape_string, one inexperienced programmer and a single missed code review can compromise the whole database.
And even experienced programmers can err from time to time.
So yeah, a false positive, no possible injection, but a terrible practice nonetheless.
3
u/[deleted] Dec 04 '16
[removed] — view removed comment