diff --git a/webmail/classes/nocc_contacts.php b/webmail/classes/nocc_contacts.php index 81a9174..610174b 100644 --- a/webmail/classes/nocc_contacts.php +++ b/webmail/classes/nocc_contacts.php @@ -10,7 +10,7 @@ * * @package NOCC * @license http://www.gnu.org/licenses/ GNU General Public License - * @version SVN: $Id: nocc_contacts.php 2629 2014-11-19 15:23:53Z oheil $ + * @version SVN: $Id: nocc_contacts.php 3062 2023-03-06 11:07:35Z oheil $ */ @@ -230,7 +230,7 @@ class NOCC_Contacts { * @todo Rewrite! */ public static function saveList($path, $contacts, $conf, &$ev) { - include 'lang/' . $_SESSION['nocc_lang'] . '.php'; + global $html_err_file_contacts; if (file_exists($path) && !is_writable($path)) { $ev = new NoccException($html_err_file_contacts); return false; diff --git a/webmail/classes/nocc_languages.php b/webmail/classes/nocc_languages.php index 470e0d2..19805ef 100644 --- a/webmail/classes/nocc_languages.php +++ b/webmail/classes/nocc_languages.php @@ -10,7 +10,7 @@ * * @package NOCC * @license http://www.gnu.org/licenses/ GNU General Public License - * @version SVN: $Id: nocc_languages.php 3060 2023-03-05 19:06:00Z oheil $ + * @version SVN: $Id: nocc_languages.php 3062 2023-03-06 11:07:35Z oheil $ */ /** @@ -55,8 +55,7 @@ class NOCC_Languages { if (substr($path, -1) != '/') { //if NOT ends with '/'... $path .= '/'; } - - $this->_languages["default"]=''; + //TODO: Move some code to a NOCC_Directory class? if ($handle = opendir($path)) { //if can open the directory... while (false !== ($name = readdir($handle))) { //for each item... @@ -81,10 +80,12 @@ class NOCC_Languages { } closedir($handle); } - + if ($this->exists($defaultLangId)) { //if the language exists... $this->_defaultLangId = strtolower($defaultLangId); } + + $this->_languages["default"]=$this->_languages[$this->_defaultLangId]; } } } @@ -167,6 +168,7 @@ class NOCC_Languages { * @return bool Successful? */ public function setSelectedLangId($langId) { +error_log("setSelectedLangId: ".$langId); if ($this->exists($langId)) { //if the language exists... $this->_selectedLangId = strtolower($langId); return true; diff --git a/webmail/common.php b/webmail/common.php index 440448f..39a4e70 100644 --- a/webmail/common.php +++ b/webmail/common.php @@ -11,7 +11,7 @@ * * @package NOCC * @license http://www.gnu.org/licenses/ GNU General Public License - * @version SVN: $Id: common.php 3060 2023-03-05 19:06:00Z oheil $ + * @version SVN: $Id: common.php 3062 2023-03-06 11:07:35Z oheil $ */ define('NOCC_DEBUG_LEVEL', 0); @@ -140,7 +140,6 @@ if (isset($_REQUEST['lang'])) { //if a language is requested... $_SESSION['nocc_lang'] = $languages->getSelectedLangId(); } } - if( isset($_SESSION['nocc_lang']) && $_SESSION['nocc_lang'] != "default" ) { //if session language already set... $languages->setSelectedLangId($_SESSION['nocc_lang']); } diff --git a/webmail/send.php b/webmail/send.php index 1d6a9ca..d233056 100644 --- a/webmail/send.php +++ b/webmail/send.php @@ -12,7 +12,7 @@ * * @package NOCC * @license http://www.gnu.org/licenses/ GNU General Public License - * @version SVN: $Id: send.php 2967 2021-12-10 14:24:34Z oheil $ + * @version SVN: $Id: send.php 3062 2023-03-06 11:07:35Z oheil $ */ require_once './common.php'; @@ -266,6 +266,7 @@ switch ($_REQUEST['sendaction']) { } else { $ev = new NoccException(i18n_message($lang_err_send_delay, $conf->send_delay)); } + header("Content-type: text/html; Charset=UTF-8"); if (NoccException::isException($ev)) { // Error while sending the message, display an error message