From b2c69ee23105f0db118d49224a96deabb37f5272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sun, 4 Feb 2024 10:37:06 +0100 Subject: [PATCH] test inlining --- lib/inliner.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/inliner.php b/lib/inliner.php index efc401b..6beaf73 100644 --- a/lib/inliner.php +++ b/lib/inliner.php @@ -1,12 +1,13 @@ tags with href attribute for CSS files - $pattern = '//i'; + $pattern = '/]*?\srel=["\']?stylesheet["\'].*?\shref=["\']?\/(.*?)["\'][^>]*?>/i'; // Use preg_replace_callback to replace matched link tags with inline styles $outputString = preg_replace_callback($pattern, function($match) { // Extract the href attribute value - $href = isset($match[1]) ? $match[1] : $match[2]; + $href = $match[1]; $fname = $_SERVER['DOCUMENT_ROOT'] . '/' . $href; echo "from $fname";