Commit 4d6a8055 authored by Dave Cridland's avatar Dave Cridland

Merge pull request #400 from sco0ter/of976

OF-976 Language is not properly set in HttpSession
parents e446347c a8596add
...@@ -34,6 +34,7 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -34,6 +34,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.openfire.SessionManager; import org.jivesoftware.openfire.SessionManager;
import org.jivesoftware.openfire.StreamID; import org.jivesoftware.openfire.StreamID;
import org.jivesoftware.openfire.auth.UnauthorizedException; import org.jivesoftware.openfire.auth.UnauthorizedException;
...@@ -43,6 +44,8 @@ import org.jivesoftware.util.TaskEngine; ...@@ -43,6 +44,8 @@ import org.jivesoftware.util.TaskEngine;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.xml.XMLConstants;
/** /**
* Manages sessions for all users connecting to Openfire using the HTTP binding protocol, * Manages sessions for all users connecting to Openfire using the HTTP binding protocol,
* <a href="http://www.xmpp.org/extensions/xep-0124.html">XEP-0124</a>. * <a href="http://www.xmpp.org/extensions/xep-0124.html">XEP-0124</a>.
...@@ -169,7 +172,7 @@ public class HttpSessionManager { ...@@ -169,7 +172,7 @@ public class HttpSessionManager {
// TODO Check if IP address is allowed to connect to the server // TODO Check if IP address is allowed to connect to the server
// Default language is English ("en"). // Default language is English ("en").
String language = rootNode.attributeValue("xml:lang"); String language = rootNode.attributeValue(QName.get("lang", XMLConstants.XML_NS_URI));
if (language == null || "".equals(language)) { if (language == null || "".equals(language)) {
language = "en"; language = "en";
} }
......
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