Skip to content

Commit

Permalink
fix regular expression
Browse files Browse the repository at this point in the history
Mit diesem Fix werden die Picture Tags korrekt erkannt, wenn mehrere auf einer Seite sind. Ohne das Fragezeichen hatte ich im ersten Match bereits 2 picture tags und die Ersetzung schlug fehl
  • Loading branch information
hirbod authored Mar 11, 2021
1 parent dde9220 commit f3b308a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/srcset.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function replaceSrcSets(rex_extension_point $ep)
}

// get all PICTURE elements with srcset attribute
preg_match_all('/<picture([^>]+)?>(.*)<\/picture>/is', $content, $matches, PREG_SET_ORDER);
preg_match_all('/<picture([^>]+)?>(.*?)<\/picture>/is', $content, $matches, PREG_SET_ORDER);
if(!empty($matches[0]))
{
$elements = array_merge($elements, $matches);
Expand Down

0 comments on commit f3b308a

Please sign in to comment.