aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/notification
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-03-08 12:36:29 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-03-08 12:36:29 +0100
commit10004c4032a86364c834574a670032d2676b87cb (patch)
treec1f4058954b4a23f148492ede9de2a0a36870bb7 /phpBB/phpbb/notification
parentf55a61d067fbc6c36348c3203e965d54b02198fd (diff)
downloadforums-10004c4032a86364c834574a670032d2676b87cb.tar
forums-10004c4032a86364c834574a670032d2676b87cb.tar.gz
forums-10004c4032a86364c834574a670032d2676b87cb.tar.bz2
forums-10004c4032a86364c834574a670032d2676b87cb.tar.xz
forums-10004c4032a86364c834574a670032d2676b87cb.zip
[ticket/14132] Use transaction for adding notifications to type table
This will prevent a race condition that might occur by two posts being submitted at the same time with the notification type IDs not being cached. PHPBB3-14132
Diffstat (limited to 'phpBB/phpbb/notification')
-rw-r--r--phpBB/phpbb/notification/manager.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index db92170dd8..233d65eebe 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -923,6 +923,8 @@ class manager
{
$notification_type_ids = $this->cache->get('notification_type_ids');
+ $this->db->sql_transaction('begin');
+
if ($notification_type_ids === false)
{
$notification_type_ids = array();
@@ -957,6 +959,8 @@ class manager
$this->cache->put('notification_type_ids', $notification_type_ids);
}
+ $this->db->sql_transaction('commit');
+
return $notification_type_ids[$notification_type_name];
}