세션 폴더에 접근할수 문제 수정 및 세션 저장경로 수정#175

This commit is contained in:
thisgun
2022-05-23 18:37:23 +09:00
parent 5a4ddbc455
commit f4aa0d0cd8
11 changed files with 124 additions and 17 deletions

View File

@ -7,4 +7,26 @@ if( isset($token) ){
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
}
if( ! function_exists('check_data_htaccess_file') ) {
function check_data_htaccess_file() {
$save_path = G5_DATA_PATH.'/.htaccess';
if( file_exists($save_path) && is_writable($save_path) ) {
$code = file_get_contents($save_path);
$add_code = 'RedirectMatch 403 /session/.*';
if( strpos($code, $add_code) === false ){
$fp = fopen($save_path, "ab");
flock( $fp, LOCK_EX );
fwrite( $fp, "\n\n" );
fwrite( $fp, $add_code );
fwrite( $fp, "\n\n" );
flock( $fp, LOCK_UN );
fclose($fp);
}
}
}
check_data_htaccess_file();
}
run_event('admin_common');