Make HTML output a little less ugly
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 4 Jan 2016 21:42:31 +0000 (22:42 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 4 Jan 2016 21:42:31 +0000 (22:42 +0100)
This change removes the large blocks of newlines where relocated
<script> blocks previously where.

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

index b2d1143909076ea249f1ed9227d97fe2f86d5017..01498ce4c29a052a3911a2a4c862205f5630b630 100644 (file)
@@ -105,10 +105,10 @@ final class HeaderUtil {
                
                // move script tags to the bottom of the page
                $javascript = array();
-               self::$output = preg_replace_callback('~(?P<conditionBefore><!--\[IF [^<]+\s*)?<script data-relocate="true"(?P<script>.*?)</script>(?P<conditionAfter>\s*<!\[ENDIF]-->)?~s', function($matches) use (&$javascript) {
+               self::$output = preg_replace_callback('~(?P<conditionBefore><!--\[IF [^<]+\s*)?<script data-relocate="true"(?P<script>.*?</script>\s*)(?P<conditionAfter><!\[ENDIF]-->\s*)?~s', function($matches) use (&$javascript) {
                        $match = '';
                        if (isset($matches['conditionBefore'])) $match .= $matches['conditionBefore'];
-                       $match .= '<script' . $matches['script'] . '</script>';
+                       $match .= '<script' . $matches['script'];
                        if (isset($matches['conditionAfter'])) $match .= $matches['conditionAfter'];
                        
                        $javascript[] = $match;