diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 837a5ba6d..6fa2263fb 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -93,6 +93,9 @@ class HTMLDisplayHandler { // move in body to the header $output = preg_replace_callback('!!is', array($this,'_moveStyleToHeader'), $output); + // move in body to the header + $output = preg_replace_callback('!!is', array($this,'_moveMetaToHeader'), $output); + // change a meta fine(widget often put the tag like to the content because of caching) $output = preg_replace_callback('//is', array($this,'_transMeta'), $output); @@ -238,6 +241,16 @@ class HTMLDisplayHandler { Context::addHtmlHeader($matches[0]); } + /** + * add meta code extracted from html body to Context, which will be + * printed inside
later. + * @param array $matches + * @return void + **/ + function _moveMetaToHeader($matches) { + Context::addHtmlHeader($matches[0]); + } + /** * add given .css or .js file names in widget code to Context * @param array $matches