Discuz教程网

Discuz 附件列表不显示附件问题

[复制链接]
authicon dly 发表于 2011-8-23 14:28:37 | 显示全部楼层 |阅读模式
当用户在版块中设置了附件扩展,且包含大小写,如: jpg,JPG

这样当用户上传了
大写扩展名之后
导致图片列表没有附件
原因是:
function_post.php
        $allowext =
str_replace(' ', '', strtolower($_G['forum']['attachextensions']));
这里对所有附件扩展名进行了小写转换

进行调用的时候:
  1. if($pid > 0) {
  2. $query = DB::query("SELECT a.*, af.*
  3. FROM ".DB::table('forum_attachment')." a
  4. LEFT JOIN ".DB::table(getattachtablebytid($_G['tid']))." af USING(aid)
  5. WHERE a.pid='$pid' ORDER BY a.aid DESC");
  6. while($attach = DB::fetch($query)) {
  7. $attach['filenametitle'] = $attach['filename'];
  8. $attach['ext'] = fileext($attach['filename']);
  9. if($allowext && !in_array($attach['ext'], $allowext)) {
  10. continue;
  11. }
  12. getattach_row($attach, $attachs, $imgattachs);
  13. }
  14. }
复制代码
应该进行转换:
$attach['ext'] = fileext($attach['filename']);
更改为:
$attach['ext'] = strtolower(fileext($attach['filename']));






上一篇:Discuz官方 相关帖子 功能分析
下一篇:discuz 简易使用DIY设置 多格多行 布条横幅 广告--DIY系列教程
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-6-17 08:05

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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