issue 1968 add meta tag in html head.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.1@10960 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
chschy 2012-07-31 06:52:19 +00:00
parent cd4650b6d8
commit bbc2adb855

View file

@ -93,6 +93,9 @@ class HTMLDisplayHandler {
// move <style ..></style> in body to the header
$output = preg_replace_callback('!<style(.*?)<\/style>!is', array($this,'_moveStyleToHeader'), $output);
// move <meta ../> in body to the header
$output = preg_replace_callback('!<meta(.*?)(?:\/|)>!is', array($this,'_moveMetaToHeader'), $output);
// change a meta fine(widget often put the tag like <!--Meta:path--> to the content because of caching)
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\/\.\@]+)-->/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 <header></header> 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