diff --git a/bbs/db_table.optimize.php b/bbs/db_table.optimize.php index f676ce4ef..3d0c38c3a 100644 --- a/bbs/db_table.optimize.php +++ b/bbs/db_table.optimize.php @@ -50,6 +50,13 @@ if($config['cf_leave_day'] > 0) { } } +// 음성 캡챠 파일 삭제 +foreach (glob(G5_PATH.'/data/cache/kcaptcha-*.mp3') as $file) { + if (filemtime($file) + 86400 < G5_SERVER_TIME) { + @unlink($file); + } +} + // 실행일 기록 if(isset($config['cf_optimize_date'])) { sql_query(" update {$g5['config_table']} set cf_optimize_date = '".G5_TIME_YMD."' "); diff --git a/plugin/kcaptcha/kcaptcha_mp3.php b/plugin/kcaptcha/kcaptcha_mp3.php index 415ba48fc..ae4bd78aa 100644 --- a/plugin/kcaptcha/kcaptcha_mp3.php +++ b/plugin/kcaptcha/kcaptcha_mp3.php @@ -26,11 +26,11 @@ function make_mp3() file_put_contents(G5_PATH.'/'.$mp3_file, $contents); - // 지난 캡챠 파일 삭제 (100번중에 한번만 실행) + // 지난 캡챠 파일 삭제 if (rand(0,99) == 0) { foreach (glob(G5_PATH.'/data/cache/kcaptcha-*.mp3') as $file) { if (filemtime($file) + 86400 < G5_SERVER_TIME) { - unset($file); + @unlink($file); } } }