/*
- * Sone - UploadImagePage.java - Copyright © 2011–2013 David Roden
+ * Sone - UploadImagePage.java - Copyright © 2011–2016 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (!currentSone.equals(parent.getSone())) {
throw new RedirectException("noPermission.html");
}
- String name = request.getHttpRequest().getPartAsStringFailsafe("title", 200);
+ String name = request.getHttpRequest().getPartAsStringFailsafe("title", 200).trim();
+ if (name.length() == 0) {
+ throw new RedirectException("emptyImageTitle.html");
+ }
String description = request.getHttpRequest().getPartAsStringFailsafe("description", 4000);
HTTPUploadedFile uploadedFile = request.getHttpRequest().getUploadedFile("image");
Bucket fileBucket = uploadedFile.getData();