Template.class的parse方法处理tmpl_begin有误

浏览:873 发布日期:2015/05/31
3.2.3 - 严重 - 未处理
Template.class的parse方法处理tmpl_begin有误
/*定义模版标签*/
'TMPL_L_DELIM'=>'{HELLO:', //模板引擎普通标签开始标记
'TMPL_R_DELIM'=>'}', //模板引擎普通标签结束标记
只要在HELLO处设置字母,就解析不了,不设置字母就可以解析

版本的处理方法:
$content = preg_replace_callback('/('.$this->config['tmpl_begin'].')([^\d\w\s'.$this->config['tmpl_begin'].$this->config['tmpl_end'].'].+?)('.$this->config['tmpl_end'].')/is', array($this, 'parseTag'),$content);
简易处理后的方法:
$content = preg_replace('/('.$this->config['tmpl_begin'].')(\S.+?)('.$this->config['tmpl_end'].')/eis',"\$this->parseTag('\\2')",$content);
评论()
后面还有条评论,点击查看>>