Support regex_replace
Torsten Landsiedel said:
I would like to know if regexp_replace would be available in Playground Fixing the native search is my use: https://wordpress.org/plugins/ignore-block-name-in-search/ But Regex_Replace is only available since MySQL 8.0.4+ and MariaDB 10.0.5+ and my check prevents the activation in Playground.
Let's support regex_replace.
Technically, that could be another custom function registered here:
https://github.com/WordPress/sqlite-database-integration/blob/3306576c9b606bc23bbb26c15383fef08e03ab11/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php#L37
Hey @adamziel
I tried to copy the regexp function to make a similar regexp_replace function, but I am not sure if this null byte check is necessary here.
Also not sure about how to test this. Is there anywhere a tutorial how to do that?
Thanks in advance!
All the best Torsten
Hey @Zodiac1978!
You could add a unit test or a few. Duplicating this one would be a good starting point. You should be able to run them as phpunit -c phpunit.xml.dist after installing the composer dependencies. Also cc @aristath
but I am not sure if this null byte check is necessary here.
I'm happy to discuss, although I'm not sure which null byte check are you referring to.
Also not sure about how to test this. Is there anywhere a tutorial how to do that?
Unfortunately there isn't, but if you documented your journey it could become that tutorial and help a lot of folks!