super.processTemplate(request, templateContext);
if (request.getMethod() == Method.POST) {
String imageId = request.getHttpRequest().getPartAsStringFailsafe("image", 36);
+ String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
Image image = webInterface.getCore().getImage(imageId, false);
if (image == null) {
throw new RedirectException("invalid.html");
image.setTitle(title);
image.setDescription(description);
webInterface.getCore().touchConfiguration();
- throw new RedirectException("imageBrowser.html?image=" + image.getId());
+ throw new RedirectException(returnPage);
}
}
<form id="edit-image" action="editImage.html" method="post">
<input type="hidden" name="formPassword" value="<%formPassword|html>" />
+ <input type="hidden" name="returnPage" value="<%request.uri|html>" />
<input type="hidden" name="image" value="<%image.id|html>" />
<div>