- 정보공유
[그누보드팁] DATA 디렉토리명 변경후 캡챠 오류 발생
data 디렉토리명을 변경시 캡챠 오류발생시 대처법.
/plugin/kcaptcha/kcaptcha_mp3.php 에서
$mp3_file = 'data/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);
// 지난 캡챠 파일 삭제
if (rand(0,99) == 0) {
foreach (glob(G5_PATH.'/data/cache/kcaptcha-*.mp3') as $file) {
if (filemtime($file) + 86400 < G5_SERVER_TIME) {
@unlink($file);
}
}
}
set_session("ss_captcha_save", $number);
return G5_URL.'/'.$mp3_file;
를
$mp3_file = 'cache/kcaptcha-'.$ip.'_'.G5_SERVER_TIME.'.mp3';
$contents = '';
foreach ($mp3s as $mp3) {
$contents .= file_get_contents($mp3);
}
file_put_contents(G5_DATA_PATH.'/'.$mp3_file, $contents);
// 지난 캡챠 파일 삭제
if (rand(0,99) == 0) {
foreach (glob(G5_DATA_PATH.'/cache/kcaptcha-*.mp3') as $file) {
if (filemtime($file) + 86400 < G5_SERVER_TIME) {
@unlink($file);
}
}
}
set_session("ss_captcha_save", $number);
return G5_DATA_URL.'/'.$mp3_file;로 변경.