aboutsummaryrefslogtreecommitdiffstats
path: root/include/common.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/common.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index 18053e3ae..50c0d73fa 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -144,6 +144,23 @@ or die ( "Could not connect to database server" );
mysql_select_db( $cfgBase )
or die ( "Could not connect to database" );
+defined('PWG_CHARSET') and defined('DB_CHARSET')
+ or die('PWG_CHARSET and/or DB_CHARSET is not defined');
+if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') )
+{
+ if (DB_CHARSET!='')
+ {
+ pwg_query('SET NAMES "'.DB_CHARSET.'"');
+ }
+}
+else
+{
+ if ( strtolower(PWG_CHARSET)!='iso-8859-1' )
+ {
+ die('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info());
+ }
+}
+
//
// Setup gallery wide options, if this fails then we output a CRITICAL_ERROR
// since basic gallery information is not available