diff --git a/lib/inliner.php b/lib/inliner.php index 629c1e7..64b7aa4 100644 --- a/lib/inliner.php +++ b/lib/inliner.php @@ -1,12 +1,12 @@ tags with href attribute for CSS files - $pattern = '//i'; + $pattern = '//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 = $match[1]; + $href = isset($match[1]) ? $match[1] : $match[2]; // Get the content of the local CSS file $cssContent = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/' . $href);