음성 캡챠 파일 삭제 코드 변경

This commit is contained in:
chicpro
2014-11-12 17:35:42 +09:00
parent 18e09702f3
commit 634d85c763
2 changed files with 9 additions and 2 deletions

View File

@ -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);
}
}
}