PHP Warning count 경고문 코드 수정 및 기타 코드 수정

This commit is contained in:
thisgun
2020-06-04 17:21:40 +09:00
parent b90b15ac77
commit 426e4e2819
3 changed files with 102 additions and 95 deletions

View File

@ -17,18 +17,18 @@ function make_mp3()
}
$ip = sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
$mp3_file = 'data/cache/kcaptcha-'.$ip.'_'.G5_SERVER_TIME.'.mp3';
$mp3_file = 'cache/kcaptcha-'.$ip.'_'.G5_SERVER_TIME.'.mp3';
$contents = '';
foreach ($mp3s as $mp3) {
$contents .= file_get_contents($mp3);
}
file_put_contents(G5_PATH.'/'.$mp3_file, $contents);
file_put_contents(G5_DATA_PATH.'/'.$mp3_file, $contents);
// 지난 캡챠 파일 삭제
if (rand(0,99) == 0) {
foreach (glob(G5_PATH.'/data/cache/kcaptcha-*.mp3') as $file) {
foreach (glob(G5_DATA_PATH.'/cache/kcaptcha-*.mp3') as $file) {
if (filemtime($file) + 86400 < G5_SERVER_TIME) {
@unlink($file);
}