aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/cache/driver/apcu.php6
-rw-r--r--phpBB/phpbb/cache/driver/memory.php5
-rw-r--r--phpBB/phpbb/db/driver/mssqlnative.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php7
-rw-r--r--phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php6
-rw-r--r--phpBB/phpbb/db/migration/data/v32x/v323.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v32x/v323rc2.php36
-rw-r--r--phpBB/phpbb/notification/method/messenger_base.php4
-rw-r--r--phpBB/phpbb/user_loader.php6
9 files changed, 96 insertions, 13 deletions
diff --git a/phpBB/phpbb/cache/driver/apcu.php b/phpBB/phpbb/cache/driver/apcu.php
index 40192e4026..c96cf0de57 100644
--- a/phpBB/phpbb/cache/driver/apcu.php
+++ b/phpBB/phpbb/cache/driver/apcu.php
@@ -25,7 +25,11 @@ class apcu extends \phpbb\cache\driver\memory
*/
function purge()
{
- apcu_clear_cache();
+ /*
+ * Use an iterator to selectively delete our cache entries without disturbing
+ * any other cache users (e.g. other phpBB boards hosted on this server)
+ */
+ apcu_delete(new \APCUIterator('#^' . $this->key_prefix . '#'));
parent::purge();
}
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php
index 052f40c243..eba9549877 100644
--- a/phpBB/phpbb/cache/driver/memory.php
+++ b/phpBB/phpbb/cache/driver/memory.php
@@ -51,10 +51,11 @@ abstract class memory extends \phpbb\cache\driver\base
function load()
{
// grab the global cache
- $this->vars = $this->_read('global');
+ $data = $this->_read('global');
- if ($this->vars !== false)
+ if ($data !== false)
{
+ $this->vars = $data;
return true;
}
diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php
index de81a6a0c8..a4dcac5966 100644
--- a/phpBB/phpbb/db/driver/mssqlnative.php
+++ b/phpBB/phpbb/db/driver/mssqlnative.php
@@ -268,7 +268,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
unset($row['line2'], $row['line3']);
}
}
- return (count($row)) ? $row : false;
+ return ($row !== null) ? $row : false;
}
/**
diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
index 508a31fba9..1e2024a071 100644
--- a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
+++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
@@ -17,7 +17,12 @@ class auth_provider_oauth extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth');
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'oauth_tokens');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_0');
}
public function update_schema()
diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php
index 98b1c2d039..88fe59ccc9 100644
--- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php
+++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php
@@ -85,13 +85,11 @@ class remove_outdated_media extends \phpbb\db\migration\migration
WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
}
- $result = $this->db->sql_query($sql);
- $this->db->sql_freeresult($result);
+ $this->db->sql_query($sql);
// delete the now empty, outdated media extension groups
$sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . '
WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
- $result = $this->db->sql_query($sql);
- $this->db->sql_freeresult($result);
+ $this->db->sql_query($sql);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v32x/v323.php b/phpBB/phpbb/db/migration/data/v32x/v323.php
new file mode 100644
index 0000000000..1ec28ceb37
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v32x/v323.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v32x;
+
+class v323 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.2.3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v32x\v323rc2',
+ );
+
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.2.3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc2.php b/phpBB/phpbb/db/migration/data/v32x/v323rc2.php
new file mode 100644
index 0000000000..32235ee067
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v32x/v323rc2.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v32x;
+
+class v323rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.2.3-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v32x\v323rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.2.3-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php
index 32e79aa936..f82017b70e 100644
--- a/phpBB/phpbb/notification/method/messenger_base.php
+++ b/phpBB/phpbb/notification/method/messenger_base.php
@@ -87,7 +87,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
$banned_users = phpbb_get_banned_user_ids($user_ids);
// Load all the users we need
- $this->user_loader->load_users($user_ids);
+ $this->user_loader->load_users(array_diff($user_ids, $banned_users), array(USER_IGNORE));
// Load the messenger
if (!class_exists('messenger'))
@@ -107,7 +107,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
$user = $this->user_loader->get_user($notification->user_id);
- if ($user['user_type'] == USER_IGNORE || ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL) || in_array($notification->user_id, $banned_users))
+ if ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL)
{
continue;
}
diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php
index 294f5208d5..9297450f3e 100644
--- a/phpBB/phpbb/user_loader.php
+++ b/phpBB/phpbb/user_loader.php
@@ -64,8 +64,9 @@ class user_loader
* Load user helper
*
* @param array $user_ids
+ * @param array $ignore_types user types to ignore
*/
- public function load_users(array $user_ids)
+ public function load_users(array $user_ids, array $ignore_types = array())
{
$user_ids[] = ANONYMOUS;
@@ -79,7 +80,8 @@ class user_loader
{
$sql = 'SELECT *
FROM ' . $this->users_table . '
- WHERE ' . $this->db->sql_in_set('user_id', $user_ids);
+ WHERE ' . $this->db->sql_in_set('user_id', $user_ids) . '
+ AND ' . $this->db->sql_in_set('user_type', $ignore_types, true, true);
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))