Prevent an extra `</script>` to be added at the end of the document
authorAlexander Ebert <ebert@woltlab.com>
Wed, 13 Nov 2024 12:31:30 +0000 (13:31 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 13 Nov 2024 12:31:30 +0000 (13:31 +0100)
See https://www.woltlab.com/community/thread/309609-%C3%A4nderung-der-script-relocation-im-output-buffer-erzeugt-zus%C3%A4tzlichen-script-tag/

wcfsetup/install/files/lib/util/HeaderUtil.class.php

index 4d2f97f4046c20a2c9c5f58295f714d22c9cf816..753d1b2e740568de7c504f1774a6bbe5b27d256c 100644 (file)
@@ -197,7 +197,7 @@ final class HeaderUtil
                 limit: 1
             );
 
-            if (!$hasMatch) {
+            if (!$hasMatch && \str_contains($segment, '<script')) {
                 self::$output .= '</script>';
             }
         }