Topic: restrict file upload to only certain extensions
This code will restrict file upload to only certain extensions.
Open file: system/classes/class_newpost.php
find this (around line 312):
$ext = '';
$allowedExtensions = array("txt","zip","rar","csv","css","doc","docx","xls","xlsx","rtf","ppt","pptx","pdf","swf","flv","avi","wmv","mov","mkv","jpg","jpeg","gif","png");
if (!in_array(end(explode(".", strtolower($filename))), $allowedExtensions)) {
return FALSE;
}
That's it.
Just change what extensions you want to allow.
Last edited by jinbatsu (2010-10-17 02:49:54)
