Merge branch 'fix/db_connect_charset' into 'develop'

removed default charset, set to auto

See merge request artica/pandorafms!1973
This commit is contained in:
nramon 2018-11-14 12:36:17 +01:00
commit 0c019d1baf
2 changed files with 8 additions and 4 deletions

View File

@ -14,7 +14,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $charset = "utf8") {
function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $charset = null) {
global $config;
if ($host === null)
@ -42,7 +42,9 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null,
}
db_change_cache_id ($db, $host);
mysqli_set_charset($connect_id, $charset);
if (isset($charset)) {
mysqli_set_charset($connect_id, $charset);
}
mysqli_select_db($connect_id, $db);
}
@ -54,7 +56,9 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null,
db_change_cache_id ($db, $host);
@mysql_set_charset($connect_id, $charset);
if (isset($charset)) {
@mysql_set_charset($connect_id, $charset);
}
mysql_select_db($db, $connect_id);
}

View File

@ -43,7 +43,7 @@ function db_select_engine() {
}
}
function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true, $charset = "utf8") {
function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true, $charset = null) {
global $config;
static $error = 0;