aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/index.php
diff options
context:
space:
mode:
authorRobert Ros <robert@robertros.nl>2014-09-18 21:33:22 +0200
committerRobert Ros <robert@robertros.nl>2014-09-18 22:29:22 +0200
commitb668db242de35f13de0b317ceaa209574458e9c8 (patch)
treebb6cf02a2049f25a67645161f32d3fb05aa2bccd /install/index.php
parenta15108e65b12ceaf50821783bcaa1ee3fee10d13 (diff)
downloadwallabag-b668db242de35f13de0b317ceaa209574458e9c8.tar.gz
wallabag-b668db242de35f13de0b317ceaa209574458e9c8.tar.zst
wallabag-b668db242de35f13de0b317ceaa209574458e9c8.zip
Convert the MySQL charset to utf8mb4 to support the full range of unicode characters
Diffstat (limited to 'install/index.php')
-rwxr-xr-xinstall/index.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/install/index.php b/install/index.php
index 1ae782a2..2b080c16 100755
--- a/install/index.php
+++ b/install/index.php
@@ -101,12 +101,14 @@ else if (isset($_POST['install'])) {
101 $content = file_get_contents('inc/poche/config.inc.php'); 101 $content = file_get_contents('inc/poche/config.inc.php');
102 102
103 if ($_POST['db_engine'] == 'mysql') { 103 if ($_POST['db_engine'] == 'mysql') {
104 $db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database']; 104 $db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'] . ';charset=utf8mb4';
105 $content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['mysql_server']."');", $content); 105 $content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['mysql_server']."');", $content);
106 $content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['mysql_database']."');", $content); 106 $content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['mysql_database']."');", $content);
107 $content = str_replace("define ('STORAGE_USER', 'poche');", "define ('STORAGE_USER', '".$_POST['mysql_user']."');", $content); 107 $content = str_replace("define ('STORAGE_USER', 'poche');", "define ('STORAGE_USER', '".$_POST['mysql_user']."');", $content);
108 $content = str_replace("define ('STORAGE_PASSWORD', 'poche');", "define ('STORAGE_PASSWORD', '".$_POST['mysql_password']."');", $content); 108 $content = str_replace("define ('STORAGE_PASSWORD', 'poche');", "define ('STORAGE_PASSWORD', '".$_POST['mysql_password']."');", $content);
109 $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password']); 109 $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password'], array(
110 PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
111 ));
110 112
111 $sql_structure = file_get_contents('install/mysql.sql'); 113 $sql_structure = file_get_contents('install/mysql.sql');
112 } 114 }