]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
check the postgresql database is UTF8 before allowing installation to proceed
authorBrenda Wallace <shiny@cpan.org>
Sat, 25 Jul 2009 03:58:42 +0000 (15:58 +1200)
committerCraig Andrews <candrews@integralblue.com>
Sat, 25 Jul 2009 04:15:35 +0000 (00:15 -0400)
install.php

index 1d3a531c5ac8c5ef984c3e71b26b1df85efbd8a1..d5e8e8b61f0864cefa3d8370418fc1ef6e0c9efb 100644 (file)
@@ -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');