lazysizes creates preg_replace PHP Error
-
With lazysizes enabled, I’m getting the following PHP error being displayed. This is replicatable from WordPress 4.9.x running PHP 7.2 and also on the current WordPress 5.4.2 running php 7.4.7
I have redacted the web dir path but the error is as follows. Let me know if you need any more detail.
When lazysizes is disabled, then this error message does not appear.
I am using the latest version lazysizes 1.2.1 however I also got it with version 1.1.0
Warning: preg_replace(): Unknown modifier '/' in [redacted web dir]/wp-content/plugins/lazysizes/inc/Lazysizes/class-pregreplace.php on line 329 Call Stack # Time Memory Function Location 1 0.0001 367160 {main}( ) .../index.php:0 2 0.0001 367440 require( '[redacted web dir]/wp-blog-header.php' ) .../index.php:17 3 0.7395 24524136 require_once( '[redacted web dir]/wp-includes/template-loader.php' ) .../wp-blog-header.php:19 4 0.7444 24561544 include( '[redacted web dir]/wp-content/themes/[redacted theme name]/page-new.php' ) .../template-loader.php:106 5 1.9940 25895160 get_template_part( ) .../page-new.php:19 6 1.9940 25895680 locate_template( ) .../general-template.php:168 7 1.9940 25895792 load_template( ) .../template.php:672 8 1.9941 25896048 require( '[redacted web dir]/wp-content/themes/[redacted theme name]/content-page.php' ) .../template.php:725 9 1.9944 25896048 the_content( ) .../content-page.php:3 10 1.9946 25896048 apply_filters( ) .../post-template.php:253 11 1.9946 25896456 WP_Hook->apply_filters( ) .../plugin.php:206 12 2.7277 47488680 Lazysizes\PluginCore->filter_html( ) .../class-wp-hook.php:287 13 2.7277 47488680 Lazysizes\PregReplace->preg_replace_html( ) .../class-plugincore.php:298 14 2.7277 47488680 Lazysizes\PregReplace->replace_generic_tag( ) .../class-pregreplace.php:66 15 2.7281 47515888 Lazysizes\PregReplace->get_replace_markup( ) .../class-pregreplace.php:173 16 2.7281 47516424 Lazysizes\PregReplace->add_lazyload_class( ) .../class-pregreplace.php:199 17 2.7281 47516776 preg_replace ( ) .../class-pregreplace.php:329
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘lazysizes creates preg_replace PHP Error’ is closed to new replies.