issue 2109 Fixed a problem in_array function

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10832 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-07-05 00:16:31 +00:00
parent e1ae5aab97
commit 1a7a68efea
18 changed files with 52 additions and 30 deletions

View file

@ -351,7 +351,7 @@ class TemplateHandler {
$nodes = preg_split($split_regex, $buff, -1, PREG_SPLIT_DELIM_CAPTURE);
// list of self closing tags
$self_closing = explode(',', 'area,base,basefont,br,hr,input,img,link,meta,param,frame,col');
$self_closing = array('area'=>1,'base'=>1,'basefont'=>1,'br'=>1,'hr'=>1,'input'=>1,'img'=>1,'link'=>1,'meta'=>1,'param'=>1,'frame'=>1,'col'=>1);
for($idx=1,$node_len=count($nodes); $idx < $node_len; $idx+=2) {
if(!($node=$nodes[$idx])) continue;
@ -392,7 +392,7 @@ class TemplateHandler {
// find closing tag
$close_php = '<?php '.str_repeat('}', $closing).' ?>';
if($node{1} == '!' || substr($node,-2,1) == '/' || in_array($tag, $self_closing)) { // self closing tag
if($node{1} == '!' || substr($node,-2,1) == '/' || isset($self_closing[$tag])) { // self closing tag
$nodes[$idx+1] = $close_php.$nodes[$idx+1];
} else {
$depth = 1;