Fixed SQL parse errors caused by conversion to \r\n by some FTP/zip clients (hackish workaround that isn't Enano's fault)
authorDan
Wed, 10 Sep 2008 06:57:54 -0400
changeset 306 7a7173c0f62f
parent 305 04f8250583e5
child 307 145b70bb8999
Fixed SQL parse errors caused by conversion to \r\n by some FTP/zip clients (hackish workaround that isn't Enano's fault)
install.php
--- a/install.php	Fri Aug 22 01:05:42 2008 -0400
+++ b/install.php	Wed Sep 10 06:57:54 2008 -0400
@@ -496,6 +496,10 @@
   $admin_user = $db->escape($admin_user);
   
   $schema = file_get_contents('schema.sql');
+  // convert \r\n in the schema to \n, in case some FTP client or zip utility ran unix2dos for us
+  // thanks to InvisGhost for reporting this error
+  $schema = str_replace("\r\n", "\n", $schema);
+  
   $schema = str_replace('{{SITE_NAME}}',    $db->escape($_POST['sitename']   ), $schema);
   $schema = str_replace('{{SITE_DESC}}',    $db->escape($_POST['sitedesc']   ), $schema);
   $schema = str_replace('{{COPYRIGHT}}',    $db->escape($_POST['copyright']  ), $schema);