diff --git a/dspace-api/src/main/resources/Messages.properties b/dspace-api/src/main/resources/Messages.properties index 0a0c062af5..e9a954befe 100644 --- a/dspace-api/src/main/resources/Messages.properties +++ b/dspace-api/src/main/resources/Messages.properties @@ -50,6 +50,8 @@ browse.sort-by.dateaccessioned = submit date browse.order.asc = Ascending browse.order.desc = Descending +feedback.error.forbidden = The feedback mail page may only be invoked from another DSpace page + help.collection-admin = /help/collection-admin.html help.index = /help/index.html help.site-admin = /help/site-admin.html diff --git a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/artifactbrowser/SendFeedbackAction.java b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/artifactbrowser/SendFeedbackAction.java index 279e4b2c34..a1625df7e1 100644 --- a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/artifactbrowser/SendFeedbackAction.java +++ b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/artifactbrowser/SendFeedbackAction.java @@ -97,14 +97,14 @@ public class SendFeedbackAction extends AbstractAction if(fromPage.indexOf(allowedReferrersSplit[i]) != -1) { validReferral = true; - break; + break; } } } String basicHost = ""; if (host.equals("localhost") || host.equals("127.0.0.1") - || host.equals(InetAddress.getLocalHost().getHostAddress())) + || host.equals(InetAddress.getLocalHost().getHostAddress())) basicHost = host; else { @@ -116,7 +116,8 @@ public class SendFeedbackAction extends AbstractAction if ((fromPage == null) || ((fromPage.indexOf(basicHost) == -1) && (validReferral == false))) { - throw new AuthorizeException(); + // N.B. must use old message catalog because Cocoon i18n is only available to transformed pages. + throw new AuthorizeException(I18nUtil.getMessage("feedback.error.forbidden")); } // User email from context