Added proper unicode support for values read from mysql

This commit is contained in:
Roman 2014-09-15 22:56:46 +03:00
parent c655fd0ee4
commit f886793742
6 changed files with 4335 additions and 2 deletions

3
README
View File

@ -3,3 +3,6 @@ Experimental fork of Lychee, a photo management system, that features a number o
* Faster photo browsing thanks to caching.
* Default sort order of albums is changed from new to old.
* Preserves scroll position when changing from albums to album and vice versa
See http://github.com/electerious/Lychee for more details on Lychee

View File

@ -146,6 +146,7 @@ album = {
albumIDs.forEach(function(id, index, array) {
albums.json.num--;
view.albums.content.delete(id);
delete albums.json.content[id]
});
} else lychee.goto("");

4324
assets/min/main.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,8 @@
# @copyright 2014 by Tobias Reich
###
header('Content-Type: text/html; charset=UTF-8');
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
@ -392,7 +394,7 @@ class Album extends Module {
# Parse
if (strlen($title)>50) $title = substr($title, 0, 50);
# Execute query
$result = $this->database->query("UPDATE lychee_albums SET title = '$title' WHERE id IN ($this->albumIDs);");

View File

@ -23,6 +23,9 @@ class Database extends Module {
# Avoid sql injection on older MySQL versions by using GBK
if ($database->server_version<50500) $database->set_charset('GBK');
else $database->set_charset("utf8");
# Set unicode
$database->query('SET NAMES utf8;');
# Check database
if (!$database->select_db($name))