Kaynağa Gözat

Merge pull request #1139 from Arantor/release-2.1

Minor buglets zapped
Arantor 10 yıl önce
ebeveyn
işleme
6fd010cd09

+ 7 - 0
Sources/LogInOut.php

@@ -208,6 +208,13 @@ function Login2()
 		return;
 	}
 
+	// And if it's too long, trim it back.
+	if ($smcFunc['strlen']($_POST['user']) > 80)
+	{
+		$_POST['user'] = $smcFunc['substr']($_POST['user'], 0, 79);
+		$context['default_username'] = preg_replace('~&#(\\d{1,7}|x[0-9a-fA-F]{1,6});~', '&#\\1;', $smcFunc['htmlspecialchars']($_POST['user']));
+	}
+
 	// Are we using any sort of integration to validate the login?
 	if (in_array('retry', call_integration_hook('integrate_validate_login', array($_POST['user'], isset($_POST['hash_passwrd']) && strlen($_POST['hash_passwrd']) == 40 ? $_POST['hash_passwrd'] : null, $modSettings['cookieTime'])), true))
 	{

+ 1 - 1
Sources/PackageGet.php

@@ -330,7 +330,7 @@ function PackageGBrowse()
 			{
 				$remote_type = $thisPackage->exists('@type') ? $thisPackage->fetch('@type') : 'relative';
 
-				if ($remote_type == 'relative' && substr($thisPackage->fetch('@href'), 0, 7) != 'http://' && substr($this->Package->fetch('@href'), 0, 8) != 'https://')
+				if ($remote_type == 'relative' && substr($thisPackage->fetch('@href'), 0, 7) != 'http://' && substr($thisPackage->fetch('@href'), 0, 8) != 'https://')
 				{
 					if (isset($_GET['absolute']))
 						$current_url = $_GET['absolute'] . '/';

+ 1 - 1
Sources/Subs-Package.php

@@ -1554,7 +1554,7 @@ function compareVersions($version1, $version2)
 
 		// Build an array of parts.
 		$versions[$id] = array(
-			'major' => (int) $parts[1],
+			'major' => !empty($parts[1]) ? (int) $parts[1] : 0,
 			'minor' => !empty($parts[2]) ? (int) $parts[2] : 0,
 			'patch' => !empty($parts[3]) ? (int) $parts[3] : 0,
 			'type' => empty($parts[4]) ? 'stable' : $parts[4],

+ 3 - 3
Themes/default/languages/EmailTemplates.english.php

@@ -44,7 +44,7 @@ Should you have any problems with the activation, please visit {ACTIVATIONLINKWI
 	@description:
 */
 $txt['resend_pending_message_subject'] = 'Welcome to {FORUMNAME}';
-$txt['resend_pending_message_body'] = 'Your registration request at {FORUMNAME} has been received, {REALNAME}.
+$txt['resend_pending_message_body'] = 'Hello {REALNAME}, your registration request at {FORUMNAME} has been received.
 
 The username you registered with was {USERNAME}.
 
@@ -639,7 +639,7 @@ You may update your profile by visiting this page after you login:
 	@description:
 */
 $txt['register_pending_subject'] = 'Welcome to {FORUMNAME}';
-$txt['register_pending_body'] = 'Your registration request at {FORUMNAME} has been received, {REALNAME}.
+$txt['register_pending_body'] = 'Hello {REALNAME}, our registration request at {FORUMNAME} has been received, {REALNAME}.
 
 The username you registered with was {USERNAME}. If you forget your password, you can change it at {FORGOTPASSWORDLINK}.
 
@@ -655,7 +655,7 @@ Before you can login and start using the forum, your request will be reviewed an
 	@description:
 */
 $txt['register_openid_pending_subject'] = 'Welcome to {FORUMNAME}';
-$txt['register_openid_pending_body'] = 'Your registration request at {FORUMNAME} has been received, {REALNAME}.
+$txt['register_openid_pending_body'] = 'Hello {REALNAME}, your registration request at {FORUMNAME} has been received.
 
 The username you registered with was {USERNAME}.
 

+ 2 - 2
other/upgrade.php

@@ -988,7 +988,7 @@ function WelcomeLogin()
 	// Do a quick version spot check.
 	$temp = substr(@implode('', @file($boarddir . '/index.php')), 0, 4096);
 	preg_match('~\*\s@version\s+(.+)[\s]{2}~i', $temp, $match);
-	if (empty($match[1]) || $match[1] != SMF_VERSION)
+	if (empty($match[1]) || (trim($match[1]) != SMF_VERSION))
 		return throw_error('The upgrader found some old or outdated files.<br /><br />Please make certain you uploaded the new versions of all the files included in the package.');
 
 	// What absolutely needs to be writable?
@@ -3117,7 +3117,7 @@ Usage: /path/to/php -f ' . basename(__FILE__) . ' -- [OPTION]...
 	// Do a quick version spot check.
 	$temp = substr(@implode('', @file($boarddir . '/index.php')), 0, 4096);
 	preg_match('~\*\s@version\s+(.+)[\s]{2}~i', $temp, $match);
-	if (empty($match[1]) || $match[1] != SMF_VERSION)
+	if (empty($match[1]) || (trim($match[1]) != SMF_VERSION))
 		print_error('Error: Some files have not yet been updated properly.');
 
 	// Make sure Settings.php is writable.