diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/constants.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 5 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 48 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 16 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_remind.php | 7 |
5 files changed, 71 insertions, 7 deletions
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 23839e3d9a..79f5a6f30f 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -28,7 +28,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.10'); +define('PHPBB_VERSION', '3.1.11-RC1'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ba448f3125..84178f74e4 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3442,6 +3442,11 @@ function get_preg_expression($mode) case 'path_remove_dot_trailing_slash': return '#^(?:(\.)?)+(?:(.+)?)+(?:([\\/\\\])$)#'; break; + + case 'semantic_version': + // Regular expression to match semantic versions by http://rgxdb.com/ + return '/(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/'; + break; } return ''; diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 32b0149701..9712b6e922 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2691,16 +2691,54 @@ function phpbb_upload_popup($forum_style = 0) /** * Do the various checks required for removing posts as well as removing it +* +* @param int $forum_id The id of the forum +* @param int $topic_id The id of the topic +* @param int $post_id The id of the post +* @param array $post_data Array with the post data +* @param bool $is_soft The flag indicating whether it is the soft delete mode +* @param string $delete_reason Description for the post deletion reason +* +* @return null */ function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $delete_reason = '') { global $user, $auth, $config, $request; - global $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx, $phpbb_dispatcher; + $force_delete_allowed = $force_softdelete_allowed = false; $perm_check = ($is_soft) ? 'softdelete' : 'delete'; + /** + * This event allows to modify the conditions for the post deletion + * + * @event core.handle_post_delete_conditions + * @var int forum_id The id of the forum + * @var int topic_id The id of the topic + * @var int post_id The id of the post + * @var array post_data Array with the post data + * @var bool is_soft The flag indicating whether it is the soft delete mode + * @var string delete_reason Description for the post deletion reason + * @var bool force_delete_allowed Allow the user to delete the post (all permissions and conditions are ignored) + * @var bool force_softdelete_allowed Allow the user to softdelete the post (all permissions and conditions are ignored) + * @var string perm_check The deletion mode softdelete|delete + * @since 3.1.11-RC1 + */ + $vars = array( + 'forum_id', + 'topic_id', + 'post_id', + 'post_data', + 'is_soft', + 'delete_reason', + 'force_delete_allowed', + 'force_softdelete_allowed', + 'perm_check', + ); + extract($phpbb_dispatcher->trigger_event('core.handle_post_delete_conditions', compact($vars))); + // If moderator removing post or user itself removing post, present a confirmation screen - if ($auth->acl_get("m_$perm_check", $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get("f_$perm_check", $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']))) + if ($force_delete_allowed || ($is_soft && $force_softdelete_allowed) || $auth->acl_get("m_$perm_check", $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get("f_$perm_check", $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']))) { $s_hidden_fields = array( 'p' => $post_id, @@ -2757,10 +2795,10 @@ function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $ } else { - global $user, $template, $request; + global $template; - $can_delete = $auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id)); - $can_softdelete = $auth->acl_get('m_softdelete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_softdelete', $forum_id)); + $can_delete = $force_delete_allowed || ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id))); + $can_softdelete = $force_softdelete_allowed || ($auth->acl_get('m_softdelete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_softdelete', $forum_id))); $template->assign_vars(array( 'S_SOFTDELETED' => $post_data['post_visibility'] == ITEM_DELETED, diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 7dbe7787cb..d5415302c8 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -676,7 +676,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) */ function merge_posts($topic_id, $to_topic_id) { - global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_dispatcher; if (!$to_topic_id) { @@ -777,6 +777,20 @@ function merge_posts($topic_id, $to_topic_id) $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); + /** + * Perform additional actions after merging posts. + * + * @event core.mcp_topics_merge_posts_after + * @var int topic_id The topic ID from which posts are being moved + * @var int to_topic_id The topic ID to which posts are being moved + * @since 3.1.11-RC1 + */ + $vars = array( + 'topic_id', + 'to_topic_id', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_topics_merge_posts_after', compact($vars))); + meta_refresh(3, $redirect); trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); } diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 29d4199528..497bf6a2c4 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -41,8 +41,15 @@ class ucp_remind $email = strtolower(request_var('email', '')); $submit = (isset($_POST['submit'])) ? true : false; + add_form_key('ucp_remind'); + if ($submit) { + if (!check_form_key('ucp_remind')) + { + trigger_error('FORM_INVALID'); + } + $sql_array = array( 'SELECT' => 'user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason', 'FROM' => array(USERS_TABLE => 'u'), |