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

Support regex_replace #47

Open
adamziel opened this issue Oct 18, 2023 · 2 comments · May be fixed by #120
Open

Support regex_replace #47

adamziel opened this issue Oct 18, 2023 · 2 comments · May be fixed by #120

Comments

@adamziel
Copy link
Collaborator

adamziel commented Oct 18, 2023

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:

$pdo->sqliteCreateFunction( $f, array( $this, $t ) );

Zodiac1978 added a commit to Zodiac1978/sqlite-database-integration that referenced this issue Jan 23, 2024
@Zodiac1978
Copy link

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

@adamziel
Copy link
Collaborator Author

adamziel commented Jan 26, 2024

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!

@Zodiac1978 Zodiac1978 linked a pull request Jun 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants