Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable $sql is null after preg_replace #2

Open
mjvermeltfoort opened this issue Jan 23, 2024 · 2 comments
Open

Variable $sql is null after preg_replace #2

mjvermeltfoort opened this issue Jan 23, 2024 · 2 comments

Comments

@mjvermeltfoort
Copy link

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

@RetroProgrammist
Copy link

$sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);

Relevant, this line is receiving an error Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zend-db/library/Zend/Db/Statement.php on line 222

@thecodecook14
Copy link

Pushed a fix of this issue here #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants