Skip to content

String color formatting error in PHP strings starting with "SELECT" #80810

Closed

Description

@MikeTodd

Steps to Reproduce

Type the following code into a PHP editor:

<?php
$a = 5;
$test = "SELECT * FROM data WHERE data_key = 'id-".intval($a)."'";

Expected: intval($a) would not be formatted as being part of the string.

Actual result: intval($a) is color coded as if it were a part of the string.

Additional notes

If you remove the "SELECT" from that string or make it lower case, the color coding works correctly.

This behavior also occurs if you begin the string with INSERT in upper case.

The color coding is also correct if you remove the first single-quote, or if you escape it with a slash. Escaping it with a slash would result in a the string actually containing a backslash and then a single quote though.

Activity

  1. roblourens commented on Sep 15, 2019

    @roblourens
    Member

    Dupe of #44290

  2. added
    *duplicate
    on Sep 15, 2019
  3. locked and limited conversation to collaborators on Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

*duplicate

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions