From a24d36825f454aaa0f8c23936c13353ae6c1f108 Mon Sep 17 00:00:00 2001 From: Jamie Burchell Date: Wed, 22 Oct 2025 12:01:42 +0100 Subject: [PATCH] Fix regex to match async and defer attributes --- Minify_AutoJs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Minify_AutoJs.php b/Minify_AutoJs.php index ad70575a5..729f7bc37 100644 --- a/Minify_AutoJs.php +++ b/Minify_AutoJs.php @@ -284,7 +284,7 @@ private function process_script_tag( $script_tag, $script_tag_number ) { ); $m = null; - if ( ! preg_match( '~\s+(async|defer)[> ]~is', $script_tag, $m ) ) { + if ( ! preg_match( '~\s+(async|defer)[>=\s]~is', $script_tag, $m ) ) { $sync_type = 'sync'; // for head group - put minified file at the place of first script