Skip to content

Commit 5a7505d

Browse files
committed
blacklist .phar extension
1 parent 0c7a4ca commit 5a7505d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/class.upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3065,7 +3065,7 @@ function process($server_path = null) {
30653065
}
30663066
// if the file is text based, or has a dangerous extension, we rename it as .txt
30673067
if ((((substr($this->file_src_mime, 0, 5) == 'text/' && $this->file_src_mime != 'text/rtf') || strpos($this->file_src_mime, 'javascript') !== false) && (substr($file_src_name, -4) != '.txt'))
3068-
|| preg_match('/\.(php|php5|php4|php3|phtml|pl|py|cgi|asp|js)$/i', $this->file_src_name)
3068+
|| preg_match('/\.(php|php5|php4|php3|phtml|pl|py|cgi|asp|js|phar)$/i', $this->file_src_name)
30693069
|| $this->file_force_extension && empty($file_src_name_ext)) {
30703070
$this->file_src_mime = 'text/plain';
30713071
if ($this->file_src_name_ext) $file_src_name_body = $file_src_name_body . '.' . $this->file_src_name_ext;

0 commit comments

Comments
 (0)