瀏覽代碼

! Make sure $modSettings['custom_avatar_dir'] is defined during the upgrade (fixes #1327)

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 10 年之前
父節點
當前提交
3e763b5ec1
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      other/upgrade.php

+ 5 - 0
other/upgrade.php

@@ -1015,6 +1015,9 @@ function WelcomeLogin()
 		$boarddir . '/Settings_bak.php',
 	);
 
+	// Do we need to add this setting?
+	$need_settings_update = empty($modSettings['custom_avatar_dir']);
+
 	$custom_av_dir = !empty($modSettings['custom_avatar_dir']) ? $modSettings['custom_avatar_dir'] : $GLOBALS['boarddir'] .'/custom_avatar';
 
 	// This little fellow has to cooperate...
@@ -1024,6 +1027,8 @@ function WelcomeLogin()
 	// Are we good now?
 	if(!is_writable($custom_av_dir))
 		return throw_error(sprintf('The directory: %1$s has to be writable to continue the upgrade. Please make sure permissions are correctly set to allow this.', $custom_av_dir));
+	elseif ($need_settings_update)
+		updateSettings(array('custom_av_dir' => $custom_av_dir));
 
 	require_once($sourcedir . '/Security.php');