Skip to content

Commit db1b4fe

Browse files
committed
blacklist .phar extension
1 parent aae61a8 commit db1b4fe

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
@@ -3064,7 +3064,7 @@ function process($server_path = null) {
30643064
}
30653065
// if the file is text based, or has a dangerous extension, we rename it as .txt
30663066
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'))
3067-
|| preg_match('/\.(php|php5|php4|php3|phtml|pl|py|cgi|asp|js)$/i', $this->file_src_name)
3067+
|| preg_match('/\.(php|php5|php4|php3|phtml|pl|py|cgi|asp|js|phar)$/i', $this->file_src_name)
30683068
|| $this->file_force_extension && empty($file_src_name_ext)) {
30693069
$this->file_src_mime = 'text/plain';
30703070
if ($this->file_src_name_ext) $file_src_name_body = $file_src_name_body . '.' . $this->file_src_name_ext;

0 commit comments

Comments
 (0)