Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[BUG] UCHOME模板中li标签超过6个变白屏

[复制链接]
源码出售 发表于 2012-6-14 12:17:01 | 显示全部楼层 |阅读模式
今天无意中发现同一段模板代码中li标签不能超过6个,下面的代码正常
<table>
<tr>
<td><ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</td>
</tr>
</table>

当偶再加一个li时:
<table>
<tr>
<td><ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
</ul>
</td>
</tr>
</table>

或者
<table>
<tr>
<td><ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</td>
<td>a</td>
</tr>
</table>
模板解析出错,页面变空白,data/tpl_cache/里生成的php文件只有1k大小 内容如下
<?php if(!defined('IN_UCHOME')) exit('Access Denied');?><?php subtplcheck('template/default/space_index|template/default/header_famous|template/default/header|template/default/space_index_menu|template/default/space_feed_li|template/default/right_standand|template/default/space_index_menu|template/default/space_feed_li|template/default/right_standand|template/default/footer|template/default/emailcheck_tips|template/default/guest_popwin_login|template/default/emailcheck_tips|template/default/guest_popwin_login|template/default/space_doing_original|template/default/right_search|template/default/space_doing_original|template/default/right_search', '1339647061', 'template/default/space_index');?><?php ob_out();?>

用NuSphere PhpED跟踪调试发现function_template.php里parse_template的function里有一段代码
        //循环
        for($i = 0; $i < 6; $i++) {
                $template = preg_replace("/\{loop\s+(\S+)\s+(\S+)\}(.+?)\{\/loop\}/ies", "stripvtags('<?php if(is_array(\\1)) { foreach(\\1 as \\2) { ?>','\\3<?php } } ?>')", $template);
                $template = preg_replace("/\{loop\s+(\S+)\s+(\S+)\s+(\S+)\}(.+?)\{\/loop\}/ies", "stripvtags('<?php if(is_array(\\1)) { foreach(\\1 as \\2 => \\3) { ?>','\\4<?php } } ?>')", $template);
                $template = preg_replace("/\{if\s+(.+?)\}(.+?)\{\/if\}/ies", "stripvtags('<?php if(\\1) { ?>','\\2<?php } ?>')", $template);
        }

当这段代码执行完 $template 变量变成空值了
有人碰到过类似的问题么?怎么解决呢?
Dicky.Net 发表于 2012-6-14 23:31:24 | 显示全部楼层
自己解决了,把Discuz! X2.5中的相关函数拿来用就没问题了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-6 14:01 , Processed in 0.092056 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表