From e1ceb050e19c7574bca146a8da7047ee4ff456b5 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Sun, 10 Jul 2016 05:02:35 -0400
Subject: [PATCH] Merge branch 'stable-3.1'

---
 interface/lib/app.inc.php |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php
index 949f164..f9ef167 100755
--- a/interface/lib/app.inc.php
+++ b/interface/lib/app.inc.php
@@ -71,6 +71,13 @@
 			$this->uses('session');
 			$sess_timeout = $this->conf('interface', 'session_timeout');
 			$cookie_domain = (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']);
+			
+			// Workaround for Nginx servers
+			if($cookie_domain == '_') {
+				$tmp = explode(':',$_SERVER["HTTP_HOST"]);
+				$cookie_domain = $tmp[0];
+				unset($tmp);
+			}
 			$cookie_secure = ($_SERVER["HTTPS"] == 'on')?true:false;
 			if($sess_timeout) {
 				/* check if user wants to stay logged in */
@@ -240,7 +247,7 @@
 			}
 			$this->_language_inc = 1;
 		}
-		if(!empty($this->_wb[$text])) {
+		if(isset($this->_wb[$text]) && $this->wb[$text] !== '') {
 			$text = $this->_wb[$text];
 		} else {
 			if($this->_conf['debug_language']) {

--
Gitblit v1.9.1