From 9141f4992cbbec3df63be656990a3271af4c3cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=BCndig?= Date: Mon, 25 Feb 2019 09:56:54 +0100 Subject: [PATCH] Match images that have attributes before "src" as well --- classes/DomManipulator.php | 2 +- updates/version.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/DomManipulator.php b/classes/DomManipulator.php index 547d8ca..b0f2b80 100644 --- a/classes/DomManipulator.php +++ b/classes/DomManipulator.php @@ -29,7 +29,7 @@ class DomManipulator * RegEx to find all images in the document. * @var string */ - protected $pattern = '/]?(?:src)=[\s\S]*?>/mis'; + protected $pattern = '/]*(?:src)=[\s\S]*?>/mis'; /** * DOMDocument instance to process each img tag. * @var DOMDocument diff --git a/updates/version.yaml b/updates/version.yaml index 1473c02..e95fc78 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -21,3 +21,4 @@ 2.0.3: Fixed handling of relative protocol urls 2.0.4: Added `svg` helper function to inline SVGs (see README for usage) 2.0.5: Added missing relations for Theme and SVGInliner classes +2.0.6: Optimized image matching to also include images with custom attributes before the src attribute