diff --git a/bbs/gcaptcha/down.php b/bbs/gcaptcha/down.php index 7bb655d24..b7057153e 100644 --- a/bbs/gcaptcha/down.php +++ b/bbs/gcaptcha/down.php @@ -2,8 +2,7 @@ include_once('./_common.php'); $file = addslashes($_GET['file']); -$captcha_path = mk_subdir($g4['cache_captcha_dir']); -$filepath = $captcha_path.'/'.$file; +$filepath = $g4['cache_captcha_path'].'/'.$file; $original = "number.wav"; if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) { diff --git a/bbs/gcaptcha/gcaptcha.lib.php b/bbs/gcaptcha/gcaptcha.lib.php index 8b33aa866..ef7ae2813 100644 --- a/bbs/gcaptcha/gcaptcha.lib.php +++ b/bbs/gcaptcha/gcaptcha.lib.php @@ -246,8 +246,6 @@ function join_wavs($wavs) function captcha_file($extension='.png') { global $g4; - mk_subdir($g4['cache_dir']); - $captcha_path = mk_subdir($g4['cache_captcha_dir']); - return $captcha_path.'/'.abs_ip2long().'_'.$_COOKIE['PHPSESSID'].$extension; + return $g4['cache_captcha_path'].'/'.abs_ip2long().'_'.$_COOKIE['PHPSESSID'].$extension; } ?> diff --git a/lib/common.lib.php b/lib/common.lib.php index 659c8e4e3..e894a7d4e 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1620,18 +1620,6 @@ function is_checked($field) } -function mk_subdir($subdir) -{ - global $g4; - $data_subpath = $g4['path_path'].'/'.$subdir; - if (!is_dir($data_subpath)) { - @mkdir($data_subpath, 0707); - @chmod($data_subpath, 0707); - } - return $data_subpath; -} - - function abs_ip2long($ip='') { $ip = $ip ? $ip : $_SERVER['REMOTE_ADDR'];