From 26acd8a5e43f6fc697728f04f4966b26bbd05230 Mon Sep 17 00:00:00 2001 From: Vishal Pandey Date: Tue, 14 Mar 2017 00:57:28 +0530 Subject: [ticket/11515] Extra check after acquiring locks. Add additional check to flock.php and db.php to ensure lock aquiring. PHPBB3-11515 --- phpBB/phpbb/lock/db.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/lock/db.php') diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php index 85ba9a7aa3..7765619422 100644 --- a/phpBB/phpbb/lock/db.php +++ b/phpBB/phpbb/lock/db.php @@ -110,7 +110,16 @@ class db // process we failed to acquire the lock. $this->locked = $this->config->set_atomic($this->config_name, $lock_value, $this->unique_id, false); - return $this->locked; + if ($this->locked == true) + { + if ($this->config->ensure_lock($this->config_name, $this->unique_id)) + { + return true; + } + } else { + + return $this->locked; + } } /** -- cgit v1.2.1 From 530e5bca87758342bfe0f212191ace8a709bdb75 Mon Sep 17 00:00:00 2001 From: Vishal Pandey Date: Tue, 14 Mar 2017 02:16:18 +0530 Subject: [ticket/11515] Change If...else statement struct Modifications in if-else structure. PHPBB3-11515 --- phpBB/phpbb/lock/db.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/lock/db.php') diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php index 7765619422..d9ad4d3b97 100644 --- a/phpBB/phpbb/lock/db.php +++ b/phpBB/phpbb/lock/db.php @@ -116,7 +116,9 @@ class db { return true; } - } else { + } + else + { return $this->locked; } -- cgit v1.2.1 From 7d4909dc064b46022020234c7316c86fc0d38a69 Mon Sep 17 00:00:00 2001 From: Vishal Pandey Date: Tue, 14 Mar 2017 17:19:41 +0530 Subject: [ticket/11515] Refactoring the patch. Removing else conditions. PHPBB3-11515 --- phpBB/phpbb/lock/db.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'phpBB/phpbb/lock/db.php') diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php index d9ad4d3b97..eea919f8f7 100644 --- a/phpBB/phpbb/lock/db.php +++ b/phpBB/phpbb/lock/db.php @@ -117,11 +117,7 @@ class db return true; } } - else - { - - return $this->locked; - } + return $this->locked; } /** -- cgit v1.2.1