Quote Originally Posted by Artificial View Post
You may want to start using ternary operators for those simple true/false if statements. Those five lines can be shortened to:

PHP Code:
return (Block.Contains(Extension)) ? false true
Also, it's not a good idea to rely on the filename passed by through the user as the determent for the file type. I can save an executable file as .jpg, and it would pass your blacklist, whereas it should get blocked. Food for thought
I honestly completely forgot about ternary. Thanks for reminding me.