From 62fd1f2124a2409ad19b3220d000c59c41134b49 Mon Sep 17 00:00:00 2001 From: ovclas Date: Thu, 3 Jan 2013 02:41:09 +0000 Subject: [PATCH] if scoped attribute in style tag, do not move to header git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12507 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/display/HTMLDisplayHandler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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]); }