當用户在版塊中設置了附件擴展,且包含大小寫, 如: 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'] = strtolower(fileext($attach['filename']));