-
Notifications
You must be signed in to change notification settings - Fork 270
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
PHP Extension: add support for mbregex #815
Comments
Thank you for reporting @jakejackson1! I understand your plugin relies on mbregex? |
@adamziel yes. The PDF library used in a plugin I help develop uses the mbregex functions. A couple of other popular plugins include the same PDF library: https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/ |
PHP configuration–wise, the However, mbregex requires the https://github.com/kkos/oniguruma library and it would have to be included as a dependency among other libraries already used (like libpng). |
## What is this PR doing? Adds the `mbregex` extension to the kitchen sink bundle. This also makes it available on the website when the "Load extensions" checkbox is clicked. Closes #815 ## Testing Instructions 1. Apply this PR 2. Open Playground, go to `/phpinfo.php` 3. Look up the mbregex extension and oniguruma 4. Confirm they're both installed
My plugin still fails on activate with Uncaught Error: Call to undefined function mb_regex_encoding() in /wordpress/wp-content/plugins/no-unsafe-inline/vendor/voku/portable-utf8/src/voku/helper/UTF8.php:536 The issue seems to be confirmed, because in https://playground.wordpress.net/ if I activate the plugin phpinfo https://wordpress.org/plugins/phpinfo-wp/ ( using PHP VERSION 8.1.23-DEV) it shows me as Configure Command:
|
It seems like a regression, thank you for reporting @MocioF. I've added this issue to the project board with a high priority. Let's include a unit test with the fix to ensure the mbregex extension keeps working over time. |
The issue is in this if. PHP versions can be I have a fix and am working on some tests to ensure it doesn't break again. |
Fixes #815 ## What is this PR doing? It fixes support for `mbregex` and adds a test to ensure it keeps working. ## What problem is it solving? Ensures support for `mbregex`. ## How is the problem addressed? By fixing a `if` condition in the Docker file that prevented PHP > 7.0 from enabling `mbregex`. Also, the code wrongly assumed that PHP 7.4 includes `oniguruma`, but it doesn't, so it's now added to PHP 7.4. ## Testing Instructions - ensure tests pass
When the mbstring PHP extension is enabled, it would be useful to enable the multibyte regex functions, too. They are currently always disabled: https://github.com/WordPress/wordpress-playground/blob/trunk/packages/php-wasm/compile/Dockerfile#L509
The text was updated successfully, but these errors were encountered: