| Current Path : /home/jeromecohp/www/aesecure/premium/setup/snippets/ |
| Current File : /home/jeromecohp/www/aesecure/premium/setup/snippets/24-block_fileupload.htaccess |
#aeSecure 2.4
<IfModule mod_php5.c>
# Do you wish to allow file uploads on your server ? User's avatar are also file and therefore if you choose the Off
# value, user won't be able to upload an avatar. Same for images that will be uploaded by an admin for an article.
php_flag file_uploads Off
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# Block any attempt to load a file with com_media. Uncomment these lines if you wish to block media manager file upload
RewriteCond %{QUERY_STRING} ^.*option=com_media.* [NC]
RewriteCond %{QUERY_STRING} ^.*task=file.upload.* [NC]
RewriteRule .* /%AESECURE_SITEROOT%aesecure/accessdenied.php?s=241 [L]
# Block file injection, ATTENTION!!! CAN BLOCK FILE UPLOAD since the rewrite cond check the presence of a filename (file.ext) on the querystring
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC]
RewriteRule .* /%AESECURE_SITEROOT%aesecure/accessdenied.php?s=242 [L]
</IfModule>