From: Brenda Wallace Date: Sat, 25 Jul 2009 03:58:42 +0000 (+1200) Subject: check the postgresql database is UTF8 before allowing installation to proceed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=70cc09a5c2863f4a9a24f65db8830146becbc72a;p=quix0rs-gnu-social.git check the postgresql database is UTF8 before allowing installation to proceed --- diff --git a/install.php b/install.php index 1d3a531c5a..d5e8e8b61f 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');