X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdb%2Fconnect_db.inc;h=bca8b86f52477a96561c1f5188d881802efe1dcd;hb=ac86042c0f4d7f15e3422d3fefdd6b7f70672129;hp=b0c33f6489c30f2fbf18368a822cfc0bd0027d41;hpb=7c430f331ccdfb35f4fb8b9b1926ce33801c9e21;p=fa-stable.git diff --git a/includes/db/connect_db.inc b/includes/db/connect_db.inc index b0c33f64..bca8b86f 100644 --- a/includes/db/connect_db.inc +++ b/includes/db/connect_db.inc @@ -26,6 +26,15 @@ function set_global_connection($company=-1) $db = mysql_connect($connection["host"], $connection["dbuser"], $connection["dbpassword"]); mysql_select_db($connection["dbname"], $db); + ///// From MySql release 5.6.6 the sql_mode is no longer empty as it was prior to + ///// this release. Just for safety we set it empty for all 5.6 release and higher. + ///// This non empty sql_mode values can interphere with FA, so all is set empty during + ///// our sessions. + ///// We are, however, investigating the existing code to be compatible in the future. + ///// We are also working on a mysql/mysqli solution to go to release 2.4. + if (strncmp(mysql_get_server_info(), "5.6", 3) >= 0) + db_query("SET sql_mode = ''"); + ///// return $db; } @@ -113,7 +122,7 @@ function db_num_fields ($result) function db_escape($value = "", $nullify = false) { $value = @html_entity_decode($value, ENT_QUOTES, $_SESSION['language']->encoding); - $value = @htmlspecialchars($value, ENT_QUOTES, $_SESSION['language']->encoding); + $value = @htmlspecialchars($value, ENT_QUOTES, $_SESSION['language']->encoding=='iso-8859-2' ? 'ISO-8859-1' : $_SESSION['language']->encoding); //reset default if second parameter is skipped $nullify = ($nullify === null) ? (false) : ($nullify);