parent
44d44e04fd
commit
0059f5910f
@ -11,4 +11,4 @@ CREATE TABLE IF NOT EXISTS `lychee_albums` (
|
||||
`visible` tinyint(1) NOT NULL DEFAULT '1',
|
||||
`password` varchar(100) DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
@ -26,4 +26,4 @@ CREATE TABLE IF NOT EXISTS `lychee_photos` (
|
||||
`album` varchar(30) NOT NULL DEFAULT '0',
|
||||
`import_name` varchar(100) DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
@ -5,4 +5,4 @@
|
||||
CREATE TABLE IF NOT EXISTS `lychee_settings` (
|
||||
`key` varchar(50) NOT NULL DEFAULT '',
|
||||
`value` varchar(200) DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
@ -19,8 +19,9 @@ class Database extends Module {
|
||||
# Check connection
|
||||
if ($database->connect_errno) exit('Error: ' . $database->connect_error);
|
||||
|
||||
# Avoid sql injection on older MySQL versions
|
||||
# Avoid sql injection on older MySQL versions by using GBK
|
||||
if ($database->server_version<50500) $database->set_charset('GBK');
|
||||
else $database->set_charset("utf8");
|
||||
|
||||
# Check database
|
||||
if (!$database->select_db($name))
|
||||
|
Loading…
Reference in New Issue
Block a user