diff options
| -rw-r--r-- | phpBB/docs/CHANGELOG.html | 2 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_forums.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/constants.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/functions_admin.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 1 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 9 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 2 | ||||
| -rw-r--r-- | phpBB/install/database_update.php | 8 | ||||
| -rw-r--r-- | phpBB/install/install_update.php | 2 | ||||
| -rw-r--r-- | phpBB/install/schemas/schema_data.sql | 2 | ||||
| -rw-r--r-- | phpBB/memberlist.php | 8 | ||||
| -rw-r--r-- | phpBB/posting.php | 13 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 39 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/template/quickreply_editor.html | 12 | 
14 files changed, 80 insertions, 29 deletions
| diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 0d3299eb89..becfa021c6 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -212,6 +212,8 @@  		<li>[Fix] Only check whether forum image exists if forum image is specified. (Bug #51905)</li>  		<li>[Fix] Fixed database updater for changes to columns having default value in MSSQL (adding/dropping constraints).</li>  		<li>[Fix] Jabber SASL PLAIN authentication failures. (Bug #52995)</li> +		<li>[Fix] Check sort options on memberlist to avoid a general error. (Bug #53655)</li> +		<li>[Fix] Fix sql error in cache_moderators() if using postgresql. (Bug #53765)</li>  		<li>[Change] Database updater now supports checking for existing/missing indexes.</li>  		<li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li>  		<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li> diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index cc56aba369..bde59ec870 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -75,13 +75,6 @@ class acp_forums  					trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);  				} -			case 'copy_perm': - -				if (!(($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) -				{ -					trigger_error($user->lang['NO_PERMISSION_COPY'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); -				} -  			break;  		} diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 7106c4efa9..398611d24e 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))  */  // phpBB Version -define('PHPBB_VERSION', '3.0.6-RC4'); +define('PHPBB_VERSION', '3.0.6');  // QA-related  // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 92dcf60ee0..ddadda8ed2 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2361,8 +2361,8 @@ function cache_moderators()  			'FROM'		=> array(  				ACL_OPTIONS_TABLE	=> 'o',  				USER_GROUP_TABLE	=> 'ug', -				ACL_GROUPS_TABLE	=> 'a',  				GROUPS_TABLE		=> 'g', +				ACL_GROUPS_TABLE	=> 'a',  			),  			'LEFT_JOIN'	=> array( diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 3783aadab5..8d9ece5205 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -105,6 +105,7 @@ class mcp_queue  				{  					$template->assign_vars(array(  						'S_TOPIC_REVIEW'	=> true, +						'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],  						'TOPIC_TITLE'		=> $post_info['topic_title'])  					);  				} diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 7bed20187a..e19fe96963 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -116,6 +116,7 @@ class mcp_reports  				{  					$template->assign_vars(array(  						'S_TOPIC_REVIEW'	=> true, +						'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],  						'TOPIC_TITLE'		=> $post_info['topic_title'])  					);  				} @@ -429,7 +430,7 @@ class mcp_reports  					'PAGE_NUMBER'			=> on_page($total, $config['topics_per_page'], $start),  					'TOPIC_ID'				=> $topic_id,  					'TOTAL'					=> $total, -					'TOTAL_REPORTS'			=> ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),					 +					'TOTAL_REPORTS'			=> ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),  					)  				); @@ -671,7 +672,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)  				$messenger->send($reporter['user_notify_type']);  			}  		} -		 +  		if (!$pm)  		{  			foreach ($post_info as $post) @@ -712,13 +713,13 @@ function close_report($report_id_list, $mode, $action, $pm = false)  			{  				$return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';  			} -			 +  			if (sizeof($topic_ids) === 1)  			{  				$return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';  			}  		} -		 +  		trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));  	}  } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 2f56bcdf7a..d9e3deaa41 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -811,7 +811,7 @@ function compose_pm($id, $mode, $action)  	}  	// Decode text for message display -	$bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh) ? $bbcode_uid : $message_parser->bbcode_uid; +	$bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && (!sizeof($error) || (sizeof($error) && !$submit))) ? $bbcode_uid : $message_parser->bbcode_uid;  	$message_parser->decode_message($bbcode_uid); diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e3511e89a4..5eeb449019 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@  *  */ -$updates_to_version = '3.0.6-RC4'; +$updates_to_version = '3.0.6';  // Enter any version to update from to test updates. The version within the db will not be updated.  $debug_from_version = false; @@ -891,6 +891,8 @@ function database_update_info()  		'3.0.6-RC2'		=> array(),  		// No changes from 3.0.6-RC3 to 3.0.6-RC4  		'3.0.6-RC3'		=> array(), +		// No changes from 3.0.6-RC4 to 3.0.6 +		'3.0.6-RC4'		=> array(),  	);  } @@ -1559,6 +1561,10 @@ function change_database_data(&$no_updates, $version)  		// No changes from 3.0.6-RC3 to 3.0.6-RC4  		case '3.0.6-RC3':  		break; + +		// No changes from 3.0.6-RC4 to 3.0.6 +		case '3.0.6-RC4': +		break;  	}  } diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 6adebc7a64..9f5a428029 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -927,7 +927,7 @@ class install_update extends module  				{  					if (function_exists('phpbb_is_writable') && !phpbb_is_writable($phpbb_root_path . 'store/'))  					{ -						trigger_error(sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $phpbb_root_path . 'store/'), E_USER_ERROR); +						trigger_error(sprintf('The directory ā%sā is not writable.', $phpbb_root_path . 'store/'), E_USER_ERROR);  					}  					if ($use_method == '.zip') diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 30ca808ef5..1c75ee4886 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -239,7 +239,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page',  INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.6-RC4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.6');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 11ff9e7685..7cffbfd854 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -976,9 +976,11 @@ switch ($mode)  			$jabber		= request_var('jabber', '');  			$search_group_id	= request_var('search_group_id', 0); +			// when using these, make sure that we actually have values defined in $find_key_match  			$joined_select	= request_var('joined_select', 'lt');  			$active_select	= request_var('active_select', 'lt');  			$count_select	= request_var('count_select', 'eq'); +  			$joined			= explode('-', request_var('joined', ''));  			$active			= explode('-', request_var('active', ''));  			$count			= (request_var('count', '') !== '') ? request_var('count', 0) : ''; @@ -1016,9 +1018,9 @@ switch ($mode)  			$sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : '';  			$sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : '';  			$sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : ''; -			$sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; -			$sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : ''; -			$sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; +			$sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; +			$sql_where .= (sizeof($joined) > 1 && isset($find_key_match[$joined_select])) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : ''; +			$sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1 && isset($find_key_match[$active_select])) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';  			$sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : '';  			if ($search_group_id) diff --git a/phpBB/posting.php b/phpBB/posting.php index 1c7cd95b81..f5d1346865 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -95,8 +95,8 @@ switch ($mode)  			FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f  			WHERE t.topic_id = $topic_id  				AND (f.forum_id = t.forum_id -					OR f.forum_id = $forum_id) -				AND t.topic_approved = 1"; +					OR f.forum_id = $forum_id)" . +			(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');  	break;  	case 'quote': @@ -125,7 +125,7 @@ switch ($mode)  				AND u.user_id = p.poster_id  				AND (f.forum_id = t.forum_id  					OR f.forum_id = $forum_id)" . -				(($auth->acl_get('m_approve', $forum_id) && $mode != 'quote') ? '' : 'AND p.post_approved = 1'); +				(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');  	break;  	case 'smilies': @@ -171,6 +171,13 @@ if (!$post_data)  	trigger_error(($mode == 'post' || $mode == 'bump' || $mode == 'reply') ? 'NO_TOPIC' : 'NO_POST');  } +// Not able to reply to unapproved posts/topics +// TODO: add more descriptive language key +if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && !$post_data['topic_approved']) || ($mode == 'quote' && !$post_data['post_approved']))) +{ +	trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED'); +} +  if ($mode == 'popup')  {  	upload_popup($post_data['forum_style']); diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 11e4315e2a..074c250b18 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -317,6 +317,39 @@ function find_in_tree(node, tag, type, class_name)  	}  } +var in_autocomplete = false; +var last_key_entered = ''; + +/** +* Check event key +*/ +function phpbb_check_key(event) +{ +	// Keycode is array down or up? +	if (event.keyCode && (event.keyCode == 40 || event.keyCode == 38)) +		in_autocomplete = true; + +	// Make sure we are not within an "autocompletion" field +	if (in_autocomplete) +	{ +		// If return pressed and key changed we reset the autocompletion +		if (!last_key_entered || last_key_entered == event.which) +		{ +			in_autocompletion = false; +			return true; +		} +	} + +	// Keycode is not return, then return. ;) +	if (event.which != 13) +	{ +		last_key_entered = event.which; +		return true; +	} + +	return false; +} +  /**  * Usually used for onkeypress event, to submit a form on enter  */ @@ -326,8 +359,7 @@ function submit_default_button(event, selector, class_name)  	if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode))  		event.which = event.charCode || event.keyCode; -	// Keycode is not return, then return. ;) -	if (event.which != 13) +	if (phpbb_check_key(event))  		return true;  	var current = selector['parentNode']; @@ -373,6 +405,9 @@ function apply_onkeypress_event()  			if (!default_button || default_button.length <= 0)  				return true; +			if (phpbb_check_key(e)) +				return true; +  			if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13))  			{  				default_button.click(); diff --git a/phpBB/styles/prosilver/template/quickreply_editor.html b/phpBB/styles/prosilver/template/quickreply_editor.html index 1ec8e2b643..f56747a842 100644 --- a/phpBB/styles/prosilver/template/quickreply_editor.html +++ b/phpBB/styles/prosilver/template/quickreply_editor.html @@ -1,12 +1,16 @@  <script type="text/javascript">  // <![CDATA[ -	function hide_qr() +	function hide_qr(show)  	{  		dE('qr_editor_div');  		dE('qr_showeditor_div'); +		if (show && document.getElementById('qr_editor_div').style.display != 'none') +		{ +			document.getElementsByName('message')[0].focus(); +		}  		return true;  	} -	 +  	function init_qr()  	{ @@ -62,7 +66,7 @@  					<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />   					<input type="submit" accesskey="f" tabindex="6" name="full_editor" value="{L_FULL_EDITOR}" class="button2" />   				</fieldset> -				<a href="" class="right-box up" onclick="hide_qr(); return false;" title="{L_COLLAPSE_QR}">{L_COLLAPSE_QR}</a> +				<a href="" class="right-box up" onclick="hide_qr(false); return false;" title="{L_COLLAPSE_QR}">{L_COLLAPSE_QR}</a>  			</div>  		<span class="corners-bottom"><span></span></span></div>  	</div> @@ -71,7 +75,7 @@  			<div class="content">  				<fieldset class="submit-buttons"> -					<input type="submit" name="show_qr" tabindex="1" class="button2" value="{L_SHOW_QR}" onclick="hide_qr();return false;"/> +					<input type="submit" name="show_qr" tabindex="1" class="button2" value="{L_SHOW_QR}" onclick="hide_qr(true);return false;"/>  				</fieldset>  			</div>  		<span class="corners-bottom"><span></span></span></div> | 
