From 3b6ebedbdab24787e18830e610231a2fc35a4e95 Mon Sep 17 00:00:00 2001
From: echicken <>
Date: Sat, 28 Sep 2013 03:03:02 +0000
Subject: [PATCH] Async requests go to http.request.host rather than
 system.inet_addr (forum was updated, but this page was neglected.)

---
 web/root/ecwebv3/pages/999-email.ssjs | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/web/root/ecwebv3/pages/999-email.ssjs b/web/root/ecwebv3/pages/999-email.ssjs
index 1304033d22..92e797096f 100644
--- a/web/root/ecwebv3/pages/999-email.ssjs
+++ b/web/root/ecwebv3/pages/999-email.ssjs
@@ -10,7 +10,7 @@ if(user.alias != webIni.WebGuest) {
 	print("<span class='title'>Email</span><br /><br />");
 	print("<div class='border box msg'>");
 	print(format(	"<a class='ulLink' onclick='addPost(\"http://%s:%s%s/forum-async.ssjs\", \"%s\", \"%s\", \"%s\", \"%s\")'>Compose a new email</a>",
-					system.inet_addr, webIni.HTTPPort, webIni.appendURL, "mail", user.alias, user.name, ""
+					http_request.host, webIni.HTTPPort, webIni.appendURL, "mail", user.alias, user.name, ""
 		)
 	);
 	print("<div id='sub-mail-newMsgBox'></div>");
@@ -18,9 +18,14 @@ if(user.alias != webIni.WebGuest) {
 	print("<div id='sub-mail' style='display:none;'></div>");
 	print("<div id='sub-mail-info' class='border box msg' style='display:none;'></div>");
 	print("<script type='text/javascript'>");
-	print("loadThreads('http://" + system.inet_addr + ":" + webIni.HTTPPort + webIni.appendURL + "/forum-async.ssjs', 'mail', " + ((http_request.query.hasOwnProperty('thread'))?false:true) + ");");
-	if(http_request.query.hasOwnProperty('thread'))
-		print("loadThread('http://" + system.inet_addr + ":" + webIni.HTTPPort + webIni.appendURL + "/forum-async.ssjs', 'mail', '" + http_request.query.thread + "', " + false + ");");
+	print(
+		"loadThreads('http://" + http_request.host + ":" + webIni.HTTPPort + webIni.appendURL + "/forum-async.ssjs', 'mail', " + ((http_request.query.hasOwnProperty('thread'))?false:true) + ");"
+	);
+	if(http_request.query.hasOwnProperty('thread')) {
+		print(
+			"loadThread('http://" + http_request.host + ":" + webIni.HTTPPort + webIni.appendURL + "/forum-async.ssjs', 'mail', '" + http_request.query.thread + "', " + false + ");"
+		);
+	}
 	print("</script>");
 
 }
\ No newline at end of file
-- 
GitLab