From f3d44c1ca1ad013af65f2a7f8e0a9e0e4c310004 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Tue, 19 Mar 2013 10:49:20 +0900 Subject: [PATCH] =?UTF-8?q?glob=20warning=20error=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index bfca25780..6e3538aeb 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1735,8 +1735,10 @@ function check_device($device) // 게시판 최신글 캐시 파일 삭제 function delete_cache_latest($bo_table) { - foreach (glob(G4_DATA_PATH.'/cache/latest-'.$bo_table.'-*') as $filename) { - unlink($filename); + $files = glob(G4_DATA_PATH.'/cache/latest-'.$bo_table.'-*'); + if (is_array($files)) { + foreach ($files as $filename) + unlink($filename); } } @@ -1747,8 +1749,10 @@ function delete_board_thumbnail($bo_table, $file) return; $fn = preg_replace("/\.[^\.]+$/i", "", basename($file)); - foreach(glob(G4_DATA_PATH.'/file/'.$bo_table.'/thumb-'.$fn.'*') as $file) { - unlink($file); + $files = glob(G4_DATA_PATH.'/file/'.$bo_table.'/thumb-'.$fn.'*'); + if (is_array($files)) { + foreach ($files as $filename) + unlink($filename); } } @@ -1784,9 +1788,10 @@ function delete_editor_thumbnail($contents) $filename = preg_replace("/\.[^\.]+$/i", "", basename($srcfile)); $filepath = dirname($srcfile); - - foreach(glob($filepath.'/thumb-'.$filename.'*') as $file) { - unlink($file); + $files = glob($filepath.'/thumb-'.$filename.'*'); + if (is_array($files)) { + foreach($files as $filename) { + unlink($filename); } } }