Просмотр исходного кода

! duplicate ID if openID active in registration, config_var with multiple=true [Bug 4891], couple of things in Subs-Members
! Fixed comment spelling error.
! added fatal_lang_error if only one board is available (MoveTopic.php [Bug: 2304]
! ip2range: used isValidIPv6 and expandeIPv6, fixed ip_array indexes

Spuds 12 лет назад
Родитель
Сommit
b364c94c23

+ 3 - 4
Sources/MoveTopic.php

@@ -75,14 +75,13 @@ function MoveTopic()
 		FROM {db_prefix}boards AS b
 			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
 		WHERE {query_see_board}
-			AND b.redirect = {string:blank_redirect}
-			AND b.id_board != {int:current_board}',
+			AND b.redirect = {string:blank_redirect}',
 		array(
 			'blank_redirect' => '',
 			'current_board' => $board,
 		)
 	);
-	$context['boards'] = array();
+	$number_of_boards = $smcFunc['db_num_rows']($request);
 	while ($row = $smcFunc['db_fetch_assoc']($request))
 	{
 		if (!isset($context['categories'][$row['id_cat']]))
@@ -101,7 +100,7 @@ function MoveTopic()
 	}
 	$smcFunc['db_free_result']($request);
 
-	if (empty($context['categories']))
+	if (empty($context['categories']) || (!empty($number_of_boards) && $number_of_boards == 1))
 		fatal_lang_error('moveto_noboards', false);
 
 	$context['page_title'] = $txt['move_topic'];

+ 1 - 1
Sources/Profile.php

@@ -392,7 +392,7 @@ function ModifyProfile($post_errors = array())
 	$current_area = $profile_include_data['current_area'];
 	$context['menu_item_selected'] = $current_area;
 
-	// Before we go any further, let's work on the area we've said is valid. Note this is done here just in case we every compromise the menu function in error!
+	// Before we go any further, let's work on the area we've said is valid. Note this is done here just in case we ever compromise the menu function in error!
 	$context['completed_save'] = false;
 	$security_checks = array();
 	$found_area = false;

+ 2 - 2
Sources/Subs-Members.php

@@ -142,8 +142,8 @@ function deleteMembers($users, $check_not_admin = false)
 	// Make these peoples' posts guest posts.
 	$smcFunc['db_query']('', '
 		UPDATE {db_prefix}messages
-		SET id_member = {int:guest_id}, ', !empty($modSettings['deleteMembersRemovesEmail']) ? '
-		poster_email = {string:blank_email}' : '', '
+		SET id_member = {int:guest_id}' . (!empty($modSettings['deleteMembersRemovesEmail']) ? ',
+		poster_email = {string:blank_email}' : '') . '
 		WHERE id_member IN ({array_int:users})',
 		array(
 			'guest_id' => 0,

+ 3 - 3
Sources/Subs.php

@@ -3206,9 +3206,9 @@ function getLegacyAttachmentFilename($filename, $attachment_id, $dir = null, $ne
 function ip2range($fullip)
 {
 	// If its IPv6, validate it first.
-	if (strpos($fullip, ':') !== false)
+	if (isValidIPv6($fullip) !== false)
 	{
-		$ip_parts = explode(':', smf_ipv6_expand($fullip, false));
+		$ip_parts = explode(':', expandIPv6($fullip, false));
 		$ip_array = array();
 
 		if (count($ip_parts) != 8)
@@ -3248,10 +3248,10 @@ function ip2range($fullip)
 	}
 
 	// Makes it simpiler to work with.
+	$ip_array[4] = array('low' => 0, 'high' => 0);
 	$ip_array[5] = array('low' => 0, 'high' => 0);
 	$ip_array[6] = array('low' => 0, 'high' => 0);
 	$ip_array[7] = array('low' => 0, 'high' => 0);
-	$ip_array[8] = array('low' => 0, 'high' => 0);
 
 	return $ip_array;
 }

+ 1 - 1
Themes/default/Admin.template.php

@@ -879,7 +879,7 @@ function template_show_settings()
 							<select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), '>';
 					foreach ($config_var['data'] as $option)
 						echo '
-								<option value="', $option[0], '"', (($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected="selected"' : ''), '>', $option[1], '</option>';
+								<option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected="selected"' : ''), '>', $option[1], '</option>';
 					echo '
 							</select>';
 				}

+ 1 - 1
Themes/default/index.template.php

@@ -258,7 +258,7 @@ function template_body_above()
 
 		if (!empty($modSettings['enableOpenID']))
 			echo '
-					<br /><input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';
+					<br /><input type="text" name="openid_identifier" size="25" class="input_text openid_login" />';
 
 		echo '
 					<input type="hidden" name="hash_passwrd" value="" />