Skip to content

Variable $sql is null after preg_replace #2

Open
@mjvermeltfoort

Description

When I create a update query with an IN statement for string that contain a double quote the $sql is null after the preg_replace at

$sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);

Original sql:
original.txt

Sql after replace on

$sql = preg_replace("/$q([^$q{$escapeChar}]*|($qe)*)*$q/s", '', $sql);

after_replace.txt

Solution is to add an null check and return an empty string on line 211

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions