rocket-lazy-load icon indicating copy to clipboard operation
rocket-lazy-load copied to clipboard

$lazy_sources triggers a undefined variable PHP notice

Open DahmaniAdame opened this issue 3 years ago • 1 comments

Undefined variable: lazy_sources in Image.php on line 273

We need to either move $lazy_sources = 0; outside of if ( preg_match_all()){} or move if ( 0 === $lazy_sources ){} inside of if ( preg_match_all()){} (like we do on WP Rocket).

https://github.com/wp-media/rocket-lazy-load/blob/4332a0d187ca39bf3ba893390e9b0bd109ee1846/src/Dependencies/RocketLazyload/Image.php#L259-L275

DahmaniAdame avatar Apr 01 '21 09:04 DahmaniAdame

Request - https://wordpress.org/support/topic/undefined-variable-lazy_sources-in-image-php-on-line-273/

DahmaniAdame avatar Apr 01 '21 09:04 DahmaniAdame