Emilis Dambauskas - 2007-06-20 08:29:59
IMHO it is more elegant to solve the problem in the web server layer.
Just disable all scripting for the uploaded file directory (Apache example):
<Directory /var/www/mysite/uploads/>
AllowOverride None
AddType text/plain .php .phtml .php3 .phps .pl .cgi
</Directory>
"AllowOverride None" disables .htaccess scripts, which can be uploaded too.
If you have a separate server for uploads, then don't install php, perl, cgi, etc. on it and you'll be safe.