Skip to content

Commit

Permalink
Block htaccess upload
Browse files Browse the repository at this point in the history
  • Loading branch information
BSteelooper committed Apr 25, 2019
1 parent 892d48a commit ebbe1f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/inc/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$lastfour = strtolower(substr(latinOnlyInput($_FILES['filefile']['name']), -4));
$lastfive = strtolower(substr(latinOnlyInput($_FILES['filefile']['name']), -5));
$blockedExtentions = array('.php','php3','php4','php5','php6','php7','phtml');
if (in_array($lastfour, $blockedExtentions) or in_array($lastfive, $blockedExtentions) ){
if (in_array($lastfour, $blockedExtentions) or in_array($lastfive, $blockedExtentions) or in_array($lastfive, '.htaccess') ){
if (!rename('files/'.latinOnlyInput($_FILES['filefile']['name']), 'files/'.latinOnlyInput($_FILES['filefile']['name']).'.txt')){
show_error($lang['general']['upload_failed'], 1);
}
Expand Down

0 comments on commit ebbe1f2

Please sign in to comment.