Browse Source

Merge pull request #1308 from Arantor/release-2.1

More fixes
Arantor 10 years ago
parent
commit
6333b895ad

+ 4 - 1
Sources/Load.php

@@ -2560,6 +2560,7 @@ function template_include($filename, $once = false)
 			$txt['template_parse_error'] = 'Template Parse Error!';
 			$txt['template_parse_error_message'] = 'It seems something has gone sour on the forum with the template system.  This problem should only be temporary, so please come back later and try again.  If you continue to see this message, please contact the administrator.<br><br>You can also try <a href="javascript:location.reload();">refreshing this page</a>.';
 			$txt['template_parse_error_details'] = 'There was a problem loading the <tt><strong>%1$s</strong></tt> template or language file.  Please check the syntax and try again - remember, single quotes (<tt>\'</tt>) often have to be escaped with a slash (<tt>\\</tt>).  To see more specific error information from PHP, try <a href="' . $boardurl . '%1$s" class="extern">accessing the file directly</a>.<br><br>You may want to try to <a href="javascript:location.reload();">refresh this page</a> or <a href="' . $scripturl . '?theme=1">use the default theme</a>.';
+			$txt['template_parse_errmsg'] = 'Unfortunately more information is not available at this time as to exactly what is wrong.';
 		}
 
 		// First, let's get the doctype and language information out of the way.
@@ -2593,8 +2594,10 @@ function template_include($filename, $once = false)
 			require_once($sourcedir . '/Subs-Package.php');
 
 			$error = fetch_web_data($boardurl . strtr($filename, array($boarddir => '', strtr($boarddir, '\\', '/') => '')));
-			if (empty($error) && ini_get('track_errors'))
+			if (empty($error) && ini_get('track_errors') && !empty($php_errormsg))
 				$error = $php_errormsg;
+			if (empty($error))
+				$error = $txt['template_parse_errmsg'];
 
 			$error = strtr($error, array('<b>' => '<strong>', '</b>' => '</strong>'));
 

+ 2 - 2
Sources/ManageSearch.php

@@ -499,8 +499,8 @@ function CreateMessageIndex()
 		$context['start'] = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
 		$context['step'] = isset($_REQUEST['step']) ? (int) $_REQUEST['step'] : 0;
 
-		// admin timeouts are painful when building these long indexes
-		if ($_SESSION['admin_time'] + 3300 < time() && $context['step'] >= 1)
+		// admin timeouts are painful when building these long indexes - but only if we actually have such things enabled
+		if (empty($modSettings['securityDisable']) && $_SESSION['admin_time'] + 3300 < time() && $context['step'] >= 1)
 			$_SESSION['admin_time'] = time();
 	}
 

+ 1 - 1
Sources/Subs-Charset.php

@@ -323,7 +323,7 @@ function utf8_strtoupper($string)
 		"\xc5\xa5" => "\xc5\xa4",		"\xc5\xa7" => "\xc5\xa6",		"\xc5\xa9" => "\xc5\xa8",		"\xc5\xab" => "\xc5\xaa",
 		"\xc5\xad" => "\xc5\xac",		"\xc5\xaf" => "\xc5\xae",		"\xc5\xb1" => "\xc5\xb0",		"\xc5\xb3" => "\xc5\xb2",
 		"\xc5\xb5" => "\xc5\xb4",		"\xc5\xb7" => "\xc5\xb6",		"\xc3\xbf" => "\xc5\xb8",		"\xc5\xba" => "\xc5\xb9",
-		"\xc5\xbc" => "\xc5\xbb",		"\xc5\xbe" => "\xc5\xbd",		"s" => "\xc5\xbf",		"\xc9\x93" => "\xc6\x81",
+		"\xc5\xbc" => "\xc5\xbb",		"\xc5\xbe" => "\xc5\xbd",		"\xc9\x93" => "\xc6\x81",
 		"\xc6\x83" => "\xc6\x82",		"\xc6\x85" => "\xc6\x84",		"\xc9\x94" => "\xc6\x86",		"\xc6\x88" => "\xc6\x87",
 		"\xc9\x96" => "\xc6\x89",		"\xc9\x97" => "\xc6\x8a",		"\xc6\x8c" => "\xc6\x8b",		"\xc7\x9d" => "\xc6\x8e",
 		"\xc9\x99" => "\xc6\x8f",		"\xc9\x9b" => "\xc6\x90",		"\xc6\x92" => "\xc6\x91",		"\xc9\xa0" => "\xc6\x93",

+ 2 - 2
Sources/Subs.php

@@ -2034,7 +2034,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 		// Item codes are complicated buggers... they are implicit [li]s and can make [list]s!
 		if ($smileys !== false && $tag === null && isset($itemcodes[$message[$pos + 1]]) && $message[$pos + 2] == ']' && !isset($disabled['list']) && !isset($disabled['li']))
 		{
-			if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", '>')))
+			if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", "\n", '>')))
 				continue;
 
 			$tag = $itemcodes[$message[$pos + 1]];
@@ -2080,7 +2080,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 			if ($pos2 !== false && ($pos2 <= $pos3 || $pos3 === false))
 			{
 				preg_match('~^(<br>|&nbsp;|\s|\[)+~', substr($message, $pos2 + 6), $matches);
-				$message = substr($message, 0, $pos2) . "\n" . (!empty($matches[0]) && substr($matches[0], -1) == '[' ? '[/li]' : '[/li][/list]') . "\n" . substr($message, $pos2);
+				$message = substr($message, 0, $pos2) . (!empty($matches[0]) && substr($matches[0], -1) == '[' ? '[/li]' : '[/li][/list]') . substr($message, $pos2);
 
 				$open_tags[count($open_tags) - 2]['after'] = '</ul>';
 			}

+ 1 - 0
Themes/default/languages/index.english.php

@@ -383,6 +383,7 @@ $txt['database_error_versions'] = '<strong>Note:</strong> It appears that your d
 $txt['template_parse_error'] = 'Template Parse Error!';
 $txt['template_parse_error_message'] = 'It seems something has gone sour on the forum with the template system.  This problem should only be temporary, so please come back later and try again.  If you continue to see this message, please contact the administrator.<br><br>You can also try <a href="javascript:location.reload();">refreshing this page</a>.';
 $txt['template_parse_error_details'] = 'There was a problem loading the <tt><strong>%1$s</strong></tt> template or language file.  Please check the syntax and try again - remember, single quotes (<tt>\'</tt>) often have to be escaped with a slash (<tt>\\</tt>).  To see more specific error information from PHP, try <a href="' . $boardurl . '%1$s">accessing the file directly</a>.<br><br>You may want to try to <a href="javascript:location.reload();">refresh this page</a> or <a href="' . $scripturl . '?theme=1">use the default theme</a>.';
+$txt['template_parse_errmsg'] = 'Unfortunately more information is not available at this time as to exactly what is wrong.';
 
 $txt['today'] = '<strong>Today</strong> at ';
 $txt['yesterday'] = '<strong>Yesterday</strong> at ';