This commit is contained in:
Amberstone 2024-09-22 09:27:53 +09:00
parent 5da8489e9a
commit aa780f540d
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
3 changed files with 3 additions and 3 deletions

View file

@ -201,7 +201,7 @@ for ($i = 1; $i <= count($_FILES['bf_file']['name']); $i++) {
$upload[$i]['filesize'] = $filesize; $upload[$i]['filesize'] = $filesize;
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함 // 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
$filename = preg_replace("/\.(php|phtm|htm|cgi|pl|exe|jsp|asp|inc)/i", "$0-x", $filename); $filename = preg_replace("/\.(php|phtm|htm|cgi|pl|exe|jsp|asp|inc|phar)/i", "$0-x", $filename);
shuffle($chars_array); shuffle($chars_array);
$shuffle = implode('', $chars_array); $shuffle = implode('', $chars_array);

View file

@ -559,7 +559,7 @@ if ($upload_count != 0) {
$upload[$i]['filesize'] = $filesize; $upload[$i]['filesize'] = $filesize;
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함 // 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
$filename = preg_replace("/\.(php|phtm|htm|cgi|pl|exe|jsp|asp|inc)/i", "$0-x", $filename); $filename = preg_replace("/\.(php|phtm|htm|cgi|pl|exe|jsp|asp|inc|phar)/i", "$0-x", $filename);
shuffle($chars_array); shuffle($chars_array);
$shuffle = implode('', $chars_array); $shuffle = implode('', $chars_array);

View file

@ -356,7 +356,7 @@ unset($row);
// data 디렉토리 및 하위 디렉토리에서는 .htaccess .htpasswd .php .phtml .html .htm .inc .cgi .pl 파일을 실행할수 없게함. // data 디렉토리 및 하위 디렉토리에서는 .htaccess .htpasswd .php .phtml .html .htm .inc .cgi .pl 파일을 실행할수 없게함.
$f = fopen($data_path . '/.htaccess', 'w'); $f = fopen($data_path . '/.htaccess', 'w');
$str = <<<EOD $str = <<<EOD
<FilesMatch "\.(htaccess|htpasswd|[Pp][Hh][Pp]|[Pp]?[Hh][Tt][Mm][Ll]?|[Ii][Nn][Cc]|[Cc][Gg][Ii]|[Pp][Ll])"> <FilesMatch "\.(htaccess|htpasswd|[Pp][Hh][Pp]|[Pp]?[Hh][Tt][Mm][Ll]?|[Ii][Nn][Cc]|[Cc][Gg][Ii]|[Pp][Ll]|[Pp][Hh][Aa][Rr])">
Order allow,deny Order allow,deny
Deny from all Deny from all
</FilesMatch> </FilesMatch>