1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-16 21:58:17 +01:00

Merge branch 'prep-release-3.3.4' into 3.3.x

This commit is contained in:
Marc Alexander 2021-05-01 21:51:16 +02:00
commit ecc79ea2ec
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
15 changed files with 158 additions and 23 deletions

View File

@ -83,7 +83,8 @@ jobs:
- name: Check commit message
if: github.event_name == 'pull_request'
run: |
git-tools/commit-msg-hook-range.sh $(git rev-list --merges -n 1 HEAD^1)..$GITHUB_SHA
git fetch origin $GITHUB_BASE_REF &> /dev/null
git-tools/commit-msg-hook-range.sh $(git rev-parse origin/$GITHUB_BASE_REF)..$GITHUB_SHA
# Tests for MySQL and MariaDB
mysql-tests:
@ -242,6 +243,16 @@ jobs:
db: "postgres:12"
- php: '7.1'
db: "postgres:13"
- php: '7.2'
db: "postgres:13"
- php: '7.3'
db: "postgres:13"
- php: '7.4'
db: "postgres:13"
- php: '8.0'
db: "postgres:12"
- php: '8.0'
db: "postgres:13"
name: PHP ${{ matrix.php }} - ${{ matrix.db }}

View File

@ -4,7 +4,7 @@
<!-- a few settings for the build -->
<property name="newversion" value="3.3.5-dev" />
<property name="prevversion" value="3.3.3" />
<property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.2.11, 3.3.0, 3.3.1, 3.3.2" />
<property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.2.11, 3.3.0, 3.3.1, 3.3.2, 3.3.4-RC1" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />

View File

@ -50,6 +50,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ul>
<li><a href="#v334rc1">Changes since 3.3.4-RC1</a></li>
<li><a href="#v333">Changes since 3.3.3</a></li>
<li><a href="#v332">Changes since 3.3.2</a></li>
<li><a href="#v331">Changes since 3.3.1</a></li>
@ -155,6 +156,16 @@
<div class="inner">
<div class="content">
<a name="v334rc1"></a><h3>Changes since 3.3.4-RC1</h3>
<h4>Bug</h4>
<ul>
<li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-16735">PHPBB3-16735</a>] - Trying to access array offset on value of type bool</li>
<li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-16739">PHPBB3-16739</a>] - Wrong variable in report_pm.txt subject</li>
<li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-16740">PHPBB3-16740</a>] - Installation errors in php 8 when using postgresql</li>
<li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-16743">PHPBB3-16743</a>] - Properly check if TMP file exists - PHP 8</li>
<li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-16747">PHPBB3-16747</a>] - Typo in phpBB/language/en/email/post_in_queue.txt </li>
</ul>
<a name="v333"></a><h3>Changes since 3.3.3</h3>
<h4>Bug</h4>
<ul>

View File

@ -247,7 +247,10 @@ define('BANLIST_TABLE', $table_prefix . 'banlist');
define('BBCODES_TABLE', $table_prefix . 'bbcodes');
define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks');
define('BOTS_TABLE', $table_prefix . 'bots');
@define('CONFIG_TABLE', $table_prefix . 'config');
if (!defined('CONFIG_TABLE'))
{
define('CONFIG_TABLE', $table_prefix . 'config');
}
define('CONFIG_TEXT_TABLE', $table_prefix . 'config_text');
define('CONFIRM_TABLE', $table_prefix . 'confirm');
define('DISALLOW_TABLE', $table_prefix . 'disallow');

View File

@ -16,10 +16,7 @@
*/
define('IN_PHPBB', true);
define('IN_INSTALL', true);
if (!defined('PHPBB_ENVIRONMENT'))
{
define('PHPBB_ENVIRONMENT', 'production');
}
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

View File

@ -23,7 +23,7 @@ if (php_sapi_name() !== 'cli')
define('IN_PHPBB', true);
define('IN_INSTALL', true);
define('PHPBB_ENVIRONMENT', 'production');
define('PHPBB_VERSION', '3.3.4-RC1');
define('PHPBB_VERSION', '3.3.4');
$phpbb_root_path = __DIR__ . '/../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

View File

@ -1,4 +1,4 @@
Subject: Post needs aprroval - "{TOPIC_TITLE}"
Subject: Post needs approval - "{TOPIC_TITLE}"
Hello {USERNAME},

View File

@ -1,4 +1,4 @@
Subject: Post needs aprroval - "{TOPIC_TITLE}"
Subject: Post needs approval - "{TOPIC_TITLE}"
Hello {USERNAME},

View File

@ -1,4 +1,4 @@
Subject: Private Message report - "{TOPIC_TITLE}"
Subject: Private Message report - "{SUBJECT}"
Hello {USERNAME},

View File

@ -153,8 +153,12 @@ class db extends base
}
$login_error_attempts = 'LOGIN_ERROR_ATTEMPTS';
$show_captcha = ($this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']) ||
($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']);
$user_login_attempts = (is_array($row) && $this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']);
$ip_login_attempts = ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']);
$show_captcha = $user_login_attempts || $ip_login_attempts;
if ($show_captcha)
{
$captcha = $this->captcha_factory->get_instance($this->config['captcha_plugin']);

View File

@ -277,9 +277,10 @@ class postgres extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
if ($cache && $cache->sql_exists($query_id))
$safe_query_id = $this->clean_query_id($query_id);
if ($cache && $cache->sql_exists($safe_query_id))
{
return $cache->sql_fetchrow($query_id);
return $cache->sql_fetchrow($safe_query_id);
}
return ($query_id) ? pg_fetch_assoc($query_id, null) : false;
@ -297,14 +298,47 @@ class postgres extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
if ($cache && $cache->sql_exists($query_id))
$safe_query_id = $this->clean_query_id($query_id);
if ($cache && $cache->sql_exists($safe_query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
return $cache->sql_rowseek($rownum, $safe_query_id);
}
return ($query_id) ? @pg_result_seek($query_id, $rownum) : false;
}
/**
* {@inheritDoc}
*/
function sql_fetchfield($field, $rownum = false, $query_id = false)
{
global $cache;
if ($query_id === false)
{
$query_id = $this->query_result;
}
if ($query_id)
{
if ($rownum !== false)
{
$this->sql_rowseek($rownum, $query_id);
}
$safe_query_id = $this->clean_query_id($query_id);
if ($cache && !is_object($query_id) && $cache->sql_exists($safe_query_id))
{
return $cache->sql_fetchfield($safe_query_id, $field);
}
$row = $this->sql_fetchrow($query_id);
return (isset($row[$field])) ? $row[$field] : false;
}
return false;
}
/**
* {@inheritDoc}
*/
@ -346,14 +380,15 @@ class postgres extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
$safe_query_id = $this->clean_query_id($query_id);
if ($cache && !is_object($query_id) && $cache->sql_exists($safe_query_id))
{
return $cache->sql_freeresult($query_id);
return $cache->sql_freeresult($safe_query_id);
}
if (isset($this->open_queries[(int) $query_id]))
if (isset($this->open_queries[$safe_query_id]))
{
unset($this->open_queries[(int) $query_id]);
unset($this->open_queries[$safe_query_id]);
return pg_free_result($query_id);
}
@ -431,6 +466,11 @@ class postgres extends \phpbb\db\driver\driver
*/
function _sql_close()
{
// Released resources are already closed, return true in this case
if (!is_resource($this->db_connect_id))
{
return true;
}
return @pg_close($this->db_connect_id);
}
@ -505,4 +545,16 @@ class postgres extends \phpbb\db\driver\driver
{
return '"' . $msg . '"';
}
/**
* Ensure query ID can be used by cache
*
* @param resource|int|string $query_id Mixed type query id
*
* @return int|string Query id in string or integer format
*/
private function clean_query_id($query_id)
{
return is_resource($query_id) ? (int) $query_id : $query_id;
}
}

View File

@ -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\v33x;
class v334 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.3.4', '>=');
}
static public function depends_on()
{
return [
'\phpbb\db\migration\data\v33x\v334rc1',
];
}
public function update_data()
{
return [
['config.update', ['version', '3.3.4']],
];
}
}

View File

@ -96,6 +96,24 @@ class postgres extends tools
return $tables;
}
/**
* {@inheritDoc}
*/
function sql_table_exists($table_name)
{
$sql = "SELECT CAST(EXISTS(
SELECT FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name = '" . $this->db->sql_escape($table_name) . "'
) AS INTEGER)";
$result = $this->db->sql_query_limit($sql, 1);
$row = $this->db->sql_fetchrow($result);
$table_exists = (booL) $row['exists'];
$this->db->sql_freeresult($result);
return $table_exists;
}
/**
* {@inheritDoc}
*/

View File

@ -476,7 +476,10 @@ class filespec
}
// Remove temporary filename
@unlink($this->filename);
if (file_exists($this->filename))
{
@unlink($this->filename);
}
if (count($this->error))
{

View File

@ -29,7 +29,7 @@ abstract class phpbb_database_test_case extends TestCase
static protected $install_schema_file;
static protected $phpunit_version;
static protected $phpunit_version;
public function __construct($name = NULL, array $data = [], $dataName = '')
{