diff --git a/www/configs/config.inc b/www/configs/config.inc index 4e415f75..e74262a1 100644 --- a/www/configs/config.inc +++ b/www/configs/config.inc @@ -262,6 +262,7 @@ if (defined('DEBUG') && DEBUG == false) { $DEBUG_ALL = 1; $PRINT_ALL = 1; $DB_DEBUG = 1; + $ENABLE_ERROR_HANDLING = 0; } // read auto loader diff --git a/www/lib/CoreLibs/ACL/Login.inc b/www/lib/CoreLibs/ACL/Login.inc index 22beae4a..a0cc78fd 100644 --- a/www/lib/CoreLibs/ACL/Login.inc +++ b/www/lib/CoreLibs/ACL/Login.inc @@ -106,7 +106,7 @@ class Login extends \CoreLibs\DB\IO public $default_acl_list = array (); // language - private $l; + public $l; // METHOD: login // PARAMS: db_config -> array for logging in to DB where edit_users tables are @@ -1173,7 +1173,7 @@ EOM; $q .= "ip, user_agent, referer, script_name, query_string, server_name, http_host, http_accept, http_accept_charset, http_accept_encoding, session_id, "; $q .= "action, action_id, action_yes, action_flag, action_menu, action_loaded, action_value, action_error) "; $q .= "VALUES ('".$this->dbEscapeString($username)."', 'PASSWORD', ".(($this->euid) ? $this->euid : 'NULL').", "; - $q .= "NOW(), '".$this->dbEscapeString($event)."', '".$this->dbEscapeString($error)."', '".$this->dbEscapeString($data)."', '".$data_binary."', '".$this->page_name."', "; + $q .= "NOW(), '".$this->dbEscapeString($event)."', '".$this->dbEscapeString((string)$error)."', '".$this->dbEscapeString($data)."', '".$data_binary."', '".$this->page_name."', "; foreach (array( 'REMOTE_ADDR', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'SCRIPT_FILENAME', 'QUERY_STRING', 'SERVER_NAME', 'HTTP_HOST', 'HTTP_ACCEPT', 'HTTP_ACCEPT_CHARSET', 'HTTP_ACCEPT_ENCODING' ) as $server_code) { diff --git a/www/lib/CoreLibs/DB/IO.inc b/www/lib/CoreLibs/DB/IO.inc index 34a8bd4c..2dbdff8e 100644 --- a/www/lib/CoreLibs/DB/IO.inc +++ b/www/lib/CoreLibs/DB/IO.inc @@ -595,15 +595,18 @@ class IO extends \CoreLibs\Basic // PARAMS: array from fetch_row // RETURN: convert fetch_row array // DESC : if there is the 'to_encoding' var set, and the field is in the wrong encoding converts it to the target - private function __dbConvertEncoding(array $row): array + private function __dbConvertEncoding($row) { - if ($this->to_encoding && $this->db_encoding) { - // go through each row and convert the encoding if needed - foreach ($row as $key => $value) { - $from_encoding = mb_detect_encoding($value); - // convert only if encoding doesn't match and source is not pure ASCII - if ($from_encoding != $this->to_encoding && $from_encoding != 'ASCII') { - $row[$key] = mb_convert_encoding($value, $this->to_encoding, $from_encoding); + // only do if array, else pass through row (can be false) + if (is_array($row)) { + if ($this->to_encoding && $this->db_encoding) { + // go through each row and convert the encoding if needed + foreach ($row as $key => $value) { + $from_encoding = mb_detect_encoding($value); + // convert only if encoding doesn't match and source is not pure ASCII + if ($from_encoding != $this->to_encoding && $from_encoding != 'ASCII') { + $row[$key] = mb_convert_encoding($value, $this->to_encoding, $from_encoding); + } } } }