diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_users.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/bbcode.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/functions_content.php | 32 | ||||
| -rw-r--r-- | phpBB/includes/functions_download.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/functions_messenger.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 24 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 5 | 
9 files changed, 56 insertions, 30 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 0ee6452ada..76b6275954 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2073,7 +2073,10 @@ class acp_users  				// Replace "error" strings with their real, localised form  				$error = array_map(array($user, 'lang'), $error); -				$decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield); +				if ($request->is_set_post('preview')) +				{ +					$decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield); +				}  				/** @var \phpbb\controller\helper $controller_helper */  				$controller_helper = $phpbb_container->get('controller.helper'); diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index f439279e78..e8969e552e 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -155,13 +155,13 @@ class bbcode  					$phpbb_container->get('filesystem'),  					$phpbb_container->get('path_helper'),  					$phpbb_container, -					$phpbb_container->getParameter('core.root_path') . 'cache/', +					$phpbb_container->getParameter('core.cache_dir'),  					$phpbb_container->get('ext.manager'),  					new \phpbb\template\twig\loader(  						$phpbb_filesystem  					)  				), -				$phpbb_container->getParameter('core.root_path') . 'cache/', +				$phpbb_container->getParameter('core.cache_dir'),  				$phpbb_container->get('user'),  				$phpbb_container->get('template.twig.extensions.collection'),  				$phpbb_extension_manager diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index be51a7342d..10788d0d6a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -96,7 +96,7 @@ function gen_rand_string_friendly($num_chars = 8)  */  function unique_id()  { -	return bin2hex(random_bytes(6)); +	return bin2hex(random_bytes(8));  }  /** @@ -1813,6 +1813,7 @@ function redirect($url, $return = false, $disable_cd_check = false)  		echo '<html dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '">';  		echo '<head>';  		echo '<meta charset="utf-8">'; +		echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';  		echo '<meta http-equiv="refresh" content="0; url=' . str_replace('&', '&', $url) . '" />';  		echo '<title>' . $user->lang['REDIRECT'] . '</title>';  		echo '</head>'; @@ -2745,7 +2746,8 @@ function get_preg_expression($mode)  			return array(  				'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',  				'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#', -				'#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">(.*?)</a><!\-\- \1 \-\->#', +				'#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="http://(.*?)">\2</a><!\-\- \1 \-\->#', +				'#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',  				'#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',  				'#<!\-\- .*? \-\->#s',  				'#<.*?>#s', @@ -3322,6 +3324,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)  			echo '<html dir="ltr">';  			echo '<head>';  			echo '<meta charset="utf-8">'; +			echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';  			echo '<title>' . $msg_title . '</title>';  			echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";  			echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } '; diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 39a3f0352f..fd7fc478bd 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -469,7 +469,7 @@ function decode_message(&$message, $bbcode_uid = '')  		$message = str_replace($match, $replace, $message);  		$match = get_preg_expression('bbcode_htm'); -		$replace = array('\1', '\1', '\3', '\1', '', ''); +		$replace = array('\1', '\1', '\2', '\2', '\1', '', '');  		$message = preg_replace($match, $replace, $message);  	} @@ -1091,17 +1091,8 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a  		unset($new_attachment_data);  	} -	// Sort correctly -	if ($config['display_order']) -	{ -		// Ascending sort -		krsort($attachments); -	} -	else -	{ -		// Descending sort -		ksort($attachments); -	} +	// Make sure attachments are properly ordered +	ksort($attachments);  	foreach ($attachments as $attachment)  	{ @@ -1309,8 +1300,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a  	$attachments = $compiled_attachments;  	unset($compiled_attachments); -	$tpl_size = sizeof($attachments); -  	$unset_tpl = array();  	preg_match_all('#<!\-\- ia([0-9]+) \-\->(.*?)<!\-\- ia\1 \-\->#', $message, $matches, PREG_PATTERN_ORDER); @@ -1318,8 +1307,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a  	$replace = array();  	foreach ($matches[0] as $num => $capture)  	{ -		// Flip index if we are displaying the reverse way -		$index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num]; +		$index = $matches[1][$num];  		$replace['from'][] = $matches[0][$num];  		$replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]); @@ -1334,6 +1322,18 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a  	$unset_tpl = array_unique($unset_tpl); +	// Sort correctly +	if ($config['display_order']) +	{ +		// Ascending sort +		krsort($attachments); +	} +	else +	{ +		// Descending sort +		ksort($attachments); +	} +  	// Needed to let not display the inlined attachments at the end of the post again  	foreach ($unset_tpl as $index)  	{ diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 916655e77c..b295d4cd1e 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -108,6 +108,7 @@ function wrap_img_in_html($src, $title)  	echo '<html>';  	echo '<head>';  	echo '<meta charset="utf-8">'; +	echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';  	echo '<title>' . $title . '</title>';  	echo '</head>';  	echo '<body>'; @@ -412,7 +413,7 @@ function set_modified_headers($stamp, $browser)  	global $request;  	// let's see if we have to send the file at all -	$last_load 	=  $request->header('Modified-Since') ? strtotime(trim($request->header('Modified-Since'))) : false; +	$last_load 	=  $request->header('If-Modified-Since') ? strtotime(trim($request->header('If-Modified-Since'))) : false;  	if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))  	{ diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index e8d4e0d7f1..f55b5e7ec3 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -640,13 +640,13 @@ class messenger  				$phpbb_container->get('filesystem'),  				$phpbb_container->get('path_helper'),  				$phpbb_container, -				$phpbb_container->getParameter('core.root_path') . 'cache/', +				$phpbb_container->getParameter('core.cache_dir'),  				$phpbb_container->get('ext.manager'),  				new \phpbb\template\twig\loader(  					$phpbb_filesystem  				)  			), -			$phpbb_container->getParameter('core.root_path') . 'cache/', +			$phpbb_container->getParameter('core.cache_dir'),  			$phpbb_container->get('user'),  			$phpbb_container->get('template.twig.extensions.collection'),  			$phpbb_extension_manager diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 0b66aae030..0e80372f43 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -530,12 +530,28 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)  		include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);  		include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); -		$user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang']; -		include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx"); +		// Attempt to translate warning to language of user being warned if user's language differs from issuer's language +		if ($user_row['user_lang'] != $user->lang_name) +		{ +			$lang = array(); + +			$user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx)) ? $user_row['user_lang'] : $config['default_lang']; +			include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx); + +			$warn_pm_subject = $lang['WARNING_PM_SUBJECT']; +			$warn_pm_body = sprintf($lang['WARNING_PM_BODY'], $warning); + +			unset($lang); +		} +		else +		{ +			$warn_pm_subject = $user->lang('WARNING_PM_SUBJECT'); +			$warn_pm_body = $user->lang('WARNING_PM_BODY', $warning); +		}  		$message_parser = new parse_message(); -		$message_parser->message = $user->lang('WARNING_PM_BODY', $warning); +		$message_parser->message = $warn_pm_body;  		$message_parser->parse(true, true, true, false, false, true, true);  		$pm_data = array( @@ -553,7 +569,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)  			'address_list'			=> array('u' => array($user_row['user_id'] => 'to')),  		); -		submit_pm('post', $user->lang('WARNING_PM_SUBJECT'), $pm_data, false); +		submit_pm('post', $warn_pm_subject, $pm_data, false);  	}  	$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING', false, array($user_row['username'])); diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index e707c251fe..1132271689 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -157,7 +157,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())  			'S_SHOW_PM_BOX'		=> true,  			'S_ALLOW_MASS_PM'	=> ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false,  			'S_GROUP_OPTIONS'	=> ($config['allow_mass_pm'] && $auth->acl_get('u_masspm_group')) ? $group_options : '', -			'U_FIND_USERNAME'	=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=postform&field=username_list&select_single=$select_single"), +			'U_FIND_USERNAME'	=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=postform&field=username_list&select_single=" . (int) $select_single),  		));  	} diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 4ac8e0f17d..5c0b792f6f 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -544,7 +544,10 @@ class ucp_profile  				// Replace "error" strings with their real, localised form  				$error = array_map(array($user, 'lang'), $error); -				$decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield); +				if ($request->is_set_post('preview')) +				{ +					$decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_flags); +				}  				/** @var \phpbb\controller\helper $controller_helper */  				$controller_helper = $phpbb_container->get('controller.helper');  | 
