사이트 내 전체검색
그누보드
[?] 버그 수정 : 업로드시 파일이 첨부안되어도 레코드 추가되는현상
로빈아빠
https://cmd.kr/gnu/219 URL이 복사되었습니다.

본문

글쓰기시 파일이 첨부되지 않았는데도 board_file_table 에 빈 레코드가 추가되는 경우를 막음.


/bbs/write_update.php 에서





$upload_count=0;
for ($i=0; $i<count($upload); $i++)
{
 if ($upload[$i][file]) $upload_count++;
}
if (!$upload_count) $upload=array();



(아래는 원래 있는 루틴)

//------------------------------------------------------------------------------
// 가변 파일 업로드
// 나중에 테이블에 저장하는 이유는 $wr_id 값을 저장해야 하기 때문입니다.
for ($i=0; $i<count($upload); $i++)
{
    $row = sql_fetch(" select count(*) as cnt from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
    if ($row[cnt])
    {

댓글목록

등록된 댓글이 없습니다.

그누보드
190 (3/4P)

Search

Copyright © Cmd 명령어 18.222.181.216