diff --git a/adm/admin.head.php b/adm/admin.head.php index 13d1251dee..0f91ddbd1e 100644 --- a/adm/admin.head.php +++ b/adm/admin.head.php @@ -130,7 +130,7 @@ function imageview(id, w, h) foreach($amenu as $key=>$value) { $href1 = $href2 = ''; - if ($menu['menu'.$key][0][2]) { + if (isset($menu['menu'.$key][0][2]) && $menu['menu'.$key][0][2]) { $href1 = ''; $href2 = ''; } else { diff --git a/adm/view.php b/adm/view.php index 58db281e88..937318e165 100644 --- a/adm/view.php +++ b/adm/view.php @@ -11,7 +11,7 @@ if( ! $is_admin ){ $sql = " select count(*) as cnt from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' "; $row = sql_fetch($sql); - if ( ! $row['cnt']) { + if (! (isset($row['cnt']) && $row['cnt'])) { return; } } diff --git a/bbs/new_delete.php b/bbs/new_delete.php index faff90f421..0cf1d425c6 100644 --- a/bbs/new_delete.php +++ b/bbs/new_delete.php @@ -53,9 +53,17 @@ // 업로드된 파일이 있다면 파일삭제 $sql2 = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "; $result2 = sql_query($sql2); - while ($row2 = sql_fetch_array($result2)) - @unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']); - + while ($row2 = sql_fetch_array($result2)){ + + $delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row2['bf_file']), $row2); + if( file_exists($delete_file) ){ + @unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']); + } + // 이미지파일이면 썸네일삭제 + if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['bf_file'])) { + delete_board_thumbnail($bo_table, $row2['bf_file']); + } + } // 파일테이블 행 삭제 sql_query(" delete from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "); @@ -63,9 +71,9 @@ } else { - // 코멘트 포인트 삭제 - if (!delete_point($row['mb_id'], $bo_table, $row['wr_id'], '코멘트')) - insert_point($row['mb_id'], $board['bo_comment_point'] * (-1), "{$board['bo_subject']} {$write['wr_id']}-{$row['wr_id']} 코멘트삭제"); + // 댓글 포인트 삭제 + if (!delete_point($row['mb_id'], $bo_table, $row['wr_id'], '댓글')) + insert_point($row['mb_id'], $board['bo_comment_point'] * (-1), "{$board['bo_subject']} {$write['wr_id']}-{$row['wr_id']} 댓글삭제"); $count_comment++; } @@ -120,8 +128,8 @@ $comment_reply = substr($write['wr_comment_reply'], 0, $len); // 코멘트 삭제 - if (!delete_point($write['mb_id'], $bo_table, $comment_id, '코멘트')) { - insert_point($write['mb_id'], $board['bo_comment_point'] * (-1), "{$board['bo_subject']} {$write['wr_parent']}-{$comment_id} 코멘트삭제"); + if (!delete_point($write['mb_id'], $bo_table, $comment_id, '댓글')) { + insert_point($write['mb_id'], $board['bo_comment_point'] * (-1), "{$board['bo_subject']} {$write['wr_parent']}-{$comment_id} 댓글삭제"); } // 코멘트 삭제 diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index 51ab514533..f983100ff9 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -227,7 +227,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h return; $size = @getimagesize($source_file); - if($size[2] < 1 || $size[2] > 3) // gif, jpg, png 에 대해서만 적용 + if(!isset($size[2]) || $size[2] < 1 || $size[2] > 3) // gif, jpg, png 에 대해서만 적용 return; if (!is_dir($target_path)) {