From 1e82eb9ecd1a950f7e7f09184508acf51075abb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sun, 4 Feb 2024 10:33:54 +0100 Subject: [PATCH] test inlining --- lib/inliner.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/inliner.php b/lib/inliner.php index f1ecbb8..a55c687 100644 --- a/lib/inliner.php +++ b/lib/inliner.php @@ -9,6 +9,7 @@ function inlineLocalStylesFromHref($inputString) { $href = isset($match[1]) ? $match[1] : $match[2]; $fname = $_SERVER['DOCUMENT_ROOT'] . '/' . $href; + echo "from $fname"; // Get the content of the local CSS file $cssContent = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/' . $href); @@ -24,7 +25,7 @@ function inlineLocalStylesFromHref($inputString) { $base64Content = base64_encode($fileContent); // Create the inline data URI - $dataUri = 'url("data:image/' . pathinfo($url, PATHINFO_EXTENSION) . ';base64,' . $base64Content . '")'; + $dataUri = 'url("data:application/octet-stream;base64,' . $base64Content . '")'; return $dataUri; }, $cssContent);