aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/index.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-04-05 00:27:20 +0200
committerThomas Citharel <tcit@tcit.fr>2015-04-05 00:27:20 +0200
commitdfc1d3e8f325cdd90d76e26d45668870181ec3b8 (patch)
tree818beba0efc502bf950f619484ce0e332e7602e5 /install/index.php
parent47424de64ed1fcb7bd5d848314581bccb11a15bb (diff)
downloadwallabag-dfc1d3e8f325cdd90d76e26d45668870181ec3b8.tar.gz
wallabag-dfc1d3e8f325cdd90d76e26d45668870181ec3b8.tar.zst
wallabag-dfc1d3e8f325cdd90d76e26d45668870181ec3b8.zip
fix bug with utf8mb4
Diffstat (limited to 'install/index.php')
-rwxr-xr-xinstall/index.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/install/index.php b/install/index.php
index 7a6eaf3a..fc16af0c 100755
--- a/install/index.php
+++ b/install/index.php
@@ -92,6 +92,8 @@ else if (isset($_POST['install'])) {
92 if ($_POST['mysql_server'] != "") {$server = $_POST['mysql_server'];} // if server and database are filled 92 if ($_POST['mysql_server'] != "") {$server = $_POST['mysql_server'];} // if server and database are filled
93 if ($_POST['mysql_database'] != "") {$database = $_POST['mysql_database'];} 93 if ($_POST['mysql_database'] != "") {$database = $_POST['mysql_database'];}
94 94
95 $sql_structure = file_get_contents('install/mysql.sql');
96
95 if (isset($_POST['mysql_utf8_mb4'])) { 97 if (isset($_POST['mysql_utf8_mb4'])) {
96 //with UTF8-MB4 98 //with UTF8-MB4
97 $db_path = 'mysql:host=' . $server . ';dbname=' . $database . ';charset=utf8mb4'; 99 $db_path = 'mysql:host=' . $server . ';dbname=' . $database . ';charset=utf8mb4';
@@ -100,7 +102,7 @@ else if (isset($_POST['install'])) {
100 )); 102 ));
101 $content = str_replace("define ('MYSQL_USE_UTF8MB4', FALSE);", "define ('MYSQL_USE_UTF8MB4', TRUE);", $content); 103 $content = str_replace("define ('MYSQL_USE_UTF8MB4', FALSE);", "define ('MYSQL_USE_UTF8MB4', TRUE);", $content);
102 } else { // regular UTF8 104 } else { // regular UTF8
103 $content = str_replace(" DEFAULT CHARSET=utf8mb4", "", $content); // replace the UTF8-MB4 occurences inside the mysql.sql file 105 $sql_structure = str_replace(" DEFAULT CHARSET=utf8mb4", "", $sql_structure); // replace the UTF8-MB4 occurences inside the mysql.sql file
104 $db_path = 'mysql:host=' . $server . ';dbname=' . $database; 106 $db_path = 'mysql:host=' . $server . ';dbname=' . $database;
105 $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password']); 107 $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password']);
106 } 108 }