Commit 9ae4aac2 authored by guus's avatar guus

OF-526: Ignore invalid JIDs.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@12988 b35dd754-fafc-0310-a699-88a17e54d16e
parent f66df779
...@@ -33,11 +33,20 @@ ...@@ -33,11 +33,20 @@
<% // Get parameters // <% // Get parameters //
boolean cancel = request.getParameter("cancel") != null; boolean cancel = request.getParameter("cancel") != null;
boolean delete = request.getParameter("delete") != null; boolean delete = request.getParameter("delete") != null;
JID roomJID = new JID(ParamUtils.getParameter(request,"roomJID")); JID roomJID = new JID(ParamUtils.getParameter(request,"roomJID"));
String alternateJIDString = ParamUtils.getParameter(request,"alternateJID"); String alternateJIDString = ParamUtils.getParameter(request,"alternateJID");
JID alternateJID; JID alternateJID = null;
if (alternateJIDString != null && alternateJIDString.trim().length() > 0 ) { if (alternateJIDString != null && alternateJIDString.trim().length() > 0 ) {
alternateJID = new JID(alternateJIDString.trim()); // OF-526: Ignore invalid alternative JIDs.
try {
alternateJID = new JID(alternateJIDString.trim());
if (alternateJID.getNode() == null) {
alternateJID == null;
}
catch (IllegalArgumentException ex) {
alternateJID = null;
}
} else { } else {
alternateJID = null; alternateJID = null;
} }
...@@ -56,11 +65,11 @@ ...@@ -56,11 +65,11 @@
// Handle a room delete: // Handle a room delete:
if (delete) { if (delete) {
// Delete the room // Delete the room
if (room != null) { if (room != null) {
// If the room still exists then destroy it // If the room still exists then destroy it
room.destroyRoom(alternateJID, reason); room.destroyRoom(alternateJID, reason);
// Log the event // Log the event
webManager.logEvent("destroyed MUC room "+roomName, "reason = "+reason+"\nalt jid = "+alternateJID); webManager.logEvent("destroyed MUC room "+roomName, "reason = "+reason+"\nalt jid = "+alternateJID.toString());
} }
// Done, so redirect // Done, so redirect
response.sendRedirect("muc-room-summary.jsp?roomJID="+URLEncoder.encode(roomJID.toBareJID(), "UTF-8")+"&deletesuccess=true"); response.sendRedirect("muc-room-summary.jsp?roomJID="+URLEncoder.encode(roomJID.toBareJID(), "UTF-8")+"&deletesuccess=true");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment