mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
[ticket/17077] Improve handling of accidental double submission of posts
PHPBB3-17077
This commit is contained in:
@@ -1429,7 +1429,10 @@ if ($submit || $preview || $refresh)
|
||||
// Store message, sync counters
|
||||
if (!count($error) && $submit)
|
||||
{
|
||||
if ($submit)
|
||||
/** @var \phpbb\lock\posting $posting_lock */
|
||||
$posting_lock = $phpbb_container->get('posting.lock');
|
||||
|
||||
if ($posting_lock->acquire())
|
||||
{
|
||||
// Lock/Unlock Topic
|
||||
$change_topic_status = $post_data['topic_status'];
|
||||
@@ -1620,6 +1623,11 @@ if ($submit || $preview || $refresh)
|
||||
|
||||
redirect($redirect_url);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Posting was already locked before, hence form submission was already attempted once and is now invalid
|
||||
$error[] = $language->lang('FORM_INVALID');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user