這樣當使用者上傳了大寫的副檔名之後
導致圖片列表沒有附件
原因是:
function_post.php
$allowext = str_replace(' ', '', strtolower($_G['forum']['attachextensions']));
這裡對所有附件副檔名進行了小寫轉換
後臺進行呼叫的時候:
- if($pid > 0) {
- $query = DB::query("SELECT a.*, af.*
- FROM ".DB::table('forum_attachment')." a
- LEFT JOIN ".DB::table(getattachtablebytid($_G['tid']))." af USING(aid)
- WHERE a.pid='$pid' ORDER BY a.aid DESC");
- while($attach = DB::fetch($query)) {
- $attach['filenametitle'] = $attach['filename'];
- $attach['ext'] = fileext($attach['filename']);
- if($allowext && !in_array($attach['ext'], $allowext)) {
- continue;
- }
- getattach_row($attach, $attachs, $imgattachs);
- }
- }
應該進行轉換:$attach['ext'] = strtolower(fileext($attach['filename']));