diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 508f86dee..1a3bff6f2 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -116,7 +116,8 @@ class HTMLDisplayHandler if(__DEBUG__==3) $start = getMicroTime(); // move in body to the header - $output = preg_replace_callback('!!is', array($this,'_moveStyleToHeader'), $output); + //$output = preg_replace_callback('!!is', array($this,'_moveStyleToHeader'), $output); + $output = preg_replace_callback('!(.*?)<\/style>!is', array($this,'_moveStyleToHeader'), $output); // move in body to the header $output = preg_replace_callback('!!is', array($this,'_moveMetaToHeader'), $output); @@ -268,6 +269,10 @@ class HTMLDisplayHandler */ function _moveStyleToHeader($matches) { + if(isset($matches[1]) && stristr($matches[1], 'scoped')) + { + return $matches[0]; + } Context::addHtmlHeader($matches[0]); }