1
0
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:
Marc Alexander
2024-04-08 21:50:27 +02:00
parent b2459edaf3
commit c07c6816fc
5 changed files with 123 additions and 2 deletions

View File

@@ -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');
}
}
}