summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers/ManageController.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-25 16:14:31 -0400
committerMichael <[email protected]>2017-03-25 16:14:31 -0400
commitd5e460acf2f9696fcecfa63d91f6b03064b1557f (patch)
tree50e59418ff2be1f76aa8d8425e79580e623622a9 /Project-Unite/Controllers/ManageController.cs
parent9c4f703176029995662311a6d297da660f27136d (diff)
downloadproject-unite-d5e460acf2f9696fcecfa63d91f6b03064b1557f.tar.gz
project-unite-d5e460acf2f9696fcecfa63d91f6b03064b1557f.tar.bz2
project-unite-d5e460acf2f9696fcecfa63d91f6b03064b1557f.zip
seriously LINQ, can't you be normal
Diffstat (limited to 'Project-Unite/Controllers/ManageController.cs')
-rw-r--r--Project-Unite/Controllers/ManageController.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Project-Unite/Controllers/ManageController.cs b/Project-Unite/Controllers/ManageController.cs
index 8bf6b78..5f68eea 100644
--- a/Project-Unite/Controllers/ManageController.cs
+++ b/Project-Unite/Controllers/ManageController.cs
@@ -42,7 +42,15 @@ namespace Project_Unite.Controllers
{
string[] allowedTypes = new[] { ".png", ".jpg", ".bmp", ".jpeg", ".gif" };
- bool containsAllowedType = !string.IsNullOrWhiteSpace(allowedTypes.FirstOrDefault(x => model.Image.FileName.EndsWith(x)));
+ bool containsAllowedType = false;
+ foreach(var ending in allowedTypes)
+ {
+ if (model.Image.FileName.EndsWith(ending))
+ {
+ containsAllowedType = true;
+ break;
+ }
+ }
if (containsAllowedType == false)
ModelState.AddModelError("UploadImageViewModel", new Exception("File type not allowed."));