aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/cache/driver/base.php5
-rw-r--r--phpBB/phpbb/cache/driver/file.php5
-rw-r--r--phpBB/phpbb/controller/helper.php9
-rw-r--r--phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php13
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v318.php31
-rw-r--r--phpBB/phpbb/notification/manager.php8
-rw-r--r--phpBB/phpbb/notification/method/messenger_base.php2
7 files changed, 60 insertions, 13 deletions
diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php
index 4c20ad916d..53c50eeda3 100644
--- a/phpBB/phpbb/cache/driver/base.php
+++ b/phpBB/phpbb/cache/driver/base.php
@@ -61,6 +61,11 @@ abstract class base implements \phpbb\cache\driver\driver_interface
unset($this->sql_rowset);
unset($this->sql_row_pointer);
+ if (function_exists('opcache_reset'))
+ {
+ @opcache_reset();
+ }
+
$this->vars = array();
$this->sql_rowset = array();
$this->sql_row_pointer = array();
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index 9a7c4aec7f..fae4614039 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -568,6 +568,11 @@ class file extends \phpbb\cache\driver\base
fclose($handle);
+ if (function_exists('opcache_invalidate'))
+ {
+ @opcache_invalidate($file);
+ }
+
if (!function_exists('phpbb_chmod'))
{
global $phpbb_root_path;
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index 79378c2434..08a63639b9 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -102,12 +102,13 @@ class helper
* @param bool $display_online_list Do we display online users list
* @param int $item_id Restrict online users to item id
* @param string $item Restrict online users to a certain session item, e.g. forum for session_forum_id
+ * @param bool $send_headers Whether headers should be sent by page_header(). Defaults to false for controllers.
*
* @return Response object containing rendered page
*/
- public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false, $item_id = 0, $item = 'forum')
+ public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = false)
{
- page_header($page_title, $display_online_list, $item_id, $item);
+ page_header($page_title, $display_online_list, $item_id, $item, $send_headers);
$this->template->set_filenames(array(
'body' => $template_file,
@@ -115,7 +116,9 @@ class helper
page_footer(true, false, false);
- return new Response($this->template->assign_display('body'), $status_code);
+ $headers = !empty($this->user->data['is_bot']) ? array('X-PHPBB-IS-BOT' => 'yes') : array();
+
+ return new Response($this->template->assign_display('body'), $status_code, $headers);
}
/**
diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
index aad8e44681..295f2d2a14 100644
--- a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
+++ b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
@@ -56,19 +56,16 @@ class passwords_convert_p1 extends \phpbb\db\migration\migration
{
// Use $CP$ prefix for passwords that need to
// be converted and set pass convert to false.
- $update_users[$user_id] = array(
- 'user_password' => '$CP$' . $row['user_password'],
- 'user_pass_convert' => 0,
- );
+ $update_users[$user_id] = '$CP$' . $row['user_password'];
}
}
$this->db->sql_freeresult($result);
- foreach ($update_users as $user_id => $user_data)
+ foreach ($update_users as $user_id => $user_password)
{
- $sql = 'UPDATE ' . $this->table_prefix . 'users
- SET ' . $this->db->sql_build_array('UPDATE', $user_data) . '
- WHERE user_id = ' . $user_id;
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_password = '" . $this->db->sql_escape($user_password) . "'
+ WHERE user_id = $user_id";
$this->sql_query($sql);
}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v318.php b/phpBB/phpbb/db/migration/data/v31x/v318.php
new file mode 100644
index 0000000000..b254279a5d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v318.php
@@ -0,0 +1,31 @@
+<?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\v31x;
+
+class v318 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v318rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.8')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index db92170dd8..222d9fe9e6 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -186,6 +186,7 @@ class manager
if (!$options['count_total'] || $total_count)
{
$rowset = array();
+ $selected_unread_count = 0;
// Get the main notifications
$sql = 'SELECT n.*, nt.notification_type_name
@@ -200,11 +201,12 @@ class manager
while ($row = $this->db->sql_fetchrow($result))
{
$rowset[$row['notification_id']] = $row;
+ $selected_unread_count += (int) !$row['notification_read'];
}
$this->db->sql_freeresult($result);
// Get all unread notifications
- if ($unread_count && $options['all_unread'] && !empty($rowset))
+ if ($selected_unread_count < $unread_count && $options['all_unread'] && !empty($rowset))
{
$sql = 'SELECT n.*, nt.notification_type_name
FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
@@ -923,6 +925,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 +961,8 @@ class manager
$this->cache->put('notification_type_ids', $notification_type_ids);
}
+ $this->db->sql_transaction('commit');
+
return $notification_type_ids[$notification_type_name];
}
diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php
index c3aee088f9..5ae96282c4 100644
--- a/phpBB/phpbb/notification/method/messenger_base.php
+++ b/phpBB/phpbb/notification/method/messenger_base.php
@@ -74,7 +74,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
continue;
}
- $messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']);
+ $messenger->template($notification->get_email_template(), $user['user_lang'], '', $template_dir_prefix);
$messenger->set_addresses($user);