Ver Fonte

Fixed a bug in SQLite upgrade script (issue upgrading from 2.0beta/RC versions)

Signed-off-by: emanuele <[email protected]>
emanuele há 11 anos atrás
pai
commit
04a0678b04
2 ficheiros alterados com 10 adições e 8 exclusões
  1. 3 2
      Sources/Attachments.php
  2. 7 6
      other/upgrade_2-0_sqlite.sql

+ 3 - 2
Sources/Attachments.php

@@ -70,7 +70,8 @@ function automanage_attachments_check_directory()
 	$sep = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? '\/' : DIRECTORY_SEPARATOR;
 	$basedirectory = rtrim($basedirectory, $sep);
 
-	switch ($modSettings['automanage_attachments']){
+	switch ($modSettings['automanage_attachments'])
+	{
 		case 1:
 			$updir = $basedirectory . DIRECTORY_SEPARATOR . 'attachments_' . (isset($modSettings['last_attachments_directory'][$base_dir]) ? $modSettings['last_attachments_directory'][$base_dir] : 0);
 			break;
@@ -165,7 +166,7 @@ function automanage_attachments_create_directory($updir)
 	}
 
 	// Everything seems fine...let's create the .htaccess
-	if (!file_exists($directory . DIRECTORY_SEPARATOR . '.htacess'))
+	if (!file_exists($directory . DIRECTORY_SEPARATOR . '.htaccess'))
 		secureDirectory($updir, true);
 
 	$sep = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? '\/' : DIRECTORY_SEPARATOR;

+ 7 - 6
other/upgrade_2-0_sqlite.sql

@@ -863,12 +863,13 @@ if ((!isset($modSettings['smfVersion']) || $modSettings['smfVersion'] <= '2.0 RC
 			$smcFunc['db_free_result']($request);
 
 			if (!empty($insertRows))
-				upgrade_query("
-					INSERT IGNORE INTO {$db_prefix}themes
-						(id_member, id_theme, variable, value)
-					VALUES
-						" . implode(',
-						', $insertRows));
+				foreach ($insertRows as $insertRow)
+					upgrade_query("
+						INSERT IGNORE INTO {$db_prefix}themes
+							(id_member, id_theme, variable, value)
+						VALUES
+							" . implode(',
+							', $insertRow));
 		}
 	}
 	$smcFunc['db_free_result']($theme_request);