diff options
| author | 2013-08-25 21:40:39 +0200 | |
|---|---|---|
| committer | 2013-08-25 21:40:39 +0200 | |
| commit | 6981a24b9c41c577d9c47e7e53c094fbecbb6b38 (patch) | |
| tree | 9a0d1eccd34752ff4d3767fd6d47d9687380965a /public/install.php | |
| parent | 4cf9119a7dfd8b8a45344dff4d884a445dcb5a5a (diff) | |
More explicit UTF-8
More explicit UTF-8 in PDO MySQL, html_entity_decode, htmlentities, and
htmlspecialchars (less important)
Diffstat (limited to 'public/install.php')
| -rw-r--r-- | public/install.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/public/install.php b/public/install.php index 3e2d7b0f9..65daed111 100644 --- a/public/install.php +++ b/public/install.php @@ -309,8 +309,12 @@ function checkBD () { try { $str = ''; + $driver_options = null; if($_SESSION['bd_type'] == 'mysql') { $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_name']; + $driver_options = array( + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' + ); } elseif($_SESSION['bd_type'] == 'sqlite') { $str = 'sqlite:' . PUBLIC_PATH . '/data/' . $_SESSION['bd_name'] . '.sqlite'; @@ -318,7 +322,8 @@ function checkBD () { $c = new PDO ($str, $_SESSION['bd_user'], - $_SESSION['bd_pass']); + $_SESSION['bd_pass'], + $driver_options); $sql = sprintf (SQL_REQ_CAT, $_SESSION['bd_prefix']); $res = $c->query ($sql); |
