Skip to content

Commit

Permalink
Modify regex #6408
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Feb 15, 2024
1 parent 4204f8c commit 2dd4775
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions inc/Engine/Media/Lazyload/CSS/Front/Extractor.php
Expand Up @@ -37,8 +37,7 @@ function ( $matches ) {
},
$content
);
$background_regex = '([^{}]+?)\s*{\s*[^}]*\bbackground\s*:\s*([^;}]+)';
//$background_regex = '(?<selector>(?:[ \-,:\w.()\n\r^>[*"\'=\]#]|(?:\[[^\]]+\]))+)\s?{[^{}]*background\s*:(?<property>[^;}]*)[^}]*}';
$background_regex = '(?P<selector>[^{}]+)\s*{\s*(?>[^{}]+{[^{}]*})*\bbackground\s*:\s*(?P<property>[^;}]+)';

$background_image_regex = '(?<selector>(?:[ \-,:\w.()\n\r^>[*"\'=\]#]|(?:\[[^\]]+\]))+)\s?{[^{}]*background-image\s*:(?<property>[^;}]*)[^}]*}';

Expand Down

0 comments on commit 2dd4775

Please sign in to comment.