diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-11-18 16:43:33 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-11-18 16:43:33 +0100 |
commit | e226efe19ae4b72bc78b89ebc2c4747ea160b80d (patch) | |
tree | 52777f0e43c3ad7b1e65c432ece4bdfece97711e /inc/template.php | |
parent | d5b233026fa2930e4c6ee362ebdfd3586b2f3fb8 (diff) | |
download | rpg-e226efe19ae4b72bc78b89ebc2c4747ea160b80d.tar.gz rpg-e226efe19ae4b72bc78b89ebc2c4747ea160b80d.tar.bz2 |
hide inline scripts from XML parsers
This patch addes some comment magic to inline scripts to hide them from
XML parsers (like the W3C CSS validator).
darcs-hash:20061118154333-7ad00-c24bc36192080fe34f232c5ec2df3f494993f2fe.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/template.php b/inc/template.php index cf3bf8da0..e9326632d 100644 --- a/inc/template.php +++ b/inc/template.php @@ -278,6 +278,11 @@ function _tpl_metaheaders_action($data){ foreach($inst as $attr){ echo '<',$tag,' ',buildAttributes($attr); if(isset($attr['_data'])){ + if($tag == 'script' && $attr['_data']) + $attr['_data'] = "<!--//--><![CDATA[//><!--\n". + $attr['_data']. + "\n//--><!]]>"; + echo '>',$attr['_data'],'</',$tag,'>'; }else{ echo '/>'; |