diff options
author | Brenda Wallace <shiny@cpan.org> | 2009-07-25 15:58:42 +1200 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-07-25 00:15:35 -0400 |
commit | 70cc09a5c2863f4a9a24f65db8830146becbc72a (patch) | |
tree | 3ba62f9bf50749230ede861c2a363aa6930562ae | |
parent | 932eab074d954b7f9add4a8b625c74a86b3bd8e1 (diff) |
check the postgresql database is UTF8 before allowing installation to proceed
-rw-r--r-- | install.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/install.php b/install.php index 1d3a531c5..d5e8e8b61 100644 --- a/install.php +++ b/install.php @@ -243,6 +243,14 @@ function pgsql_db_installer($host, $database, $username, $password, $sitename) { updateStatus("Checking database..."); $conn = pg_connect($connstring); + //ensure database encoding is UTF8 + $record = pg_fetch_object(pg_query($conn, 'SHOW server_encoding')); + if ($record->server_encoding != 'UTF8') { + updateStatus("Laconica requires UTF8 character encoding. Your database is ". htmlentities($record->server_encoding)); + showForm(); + return false; + } + updateStatus("Running database script..."); //wrap in transaction; pg_query($conn, 'BEGIN'); |