Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Lint

# PHP syntax check on the lowest PHP version this extension supports and the
# newest one phpBB 3.3 supports. tests.yml covers PHP 8.2 with phpBB's own
# checks (code sniffer, EPV).
# newest one phpBB 3.3 supports. tests.yml runs phpBB's own checks (code
# sniffer, EPV) on phpBB 3.3 with PHP 7.4 and on phpBB 4.0 with PHP 8.2.
on:
push:
branches:
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ env:
IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0
EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0
EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0
PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on

on:
push:
Expand All @@ -26,11 +25,24 @@ jobs:
matrix:
# php-versions: ['8.1']
include:
# phpBB 3.3 with the extension's minimum PHP
- php: '7.4'
db: 'none'
NOTESTS: 1
phpbb: '3.3.x'
composer: 'composer'
epv: 'dev-master'
# phpBB 4.0 (the master branch) with its minimum PHP. EPV's
# phpBB 4.0 branch, installed with phpBB's own Composer, as
# phpbb-extensions/test-framework does for phpBB 4.0
- php: '8.2'
db: 'none'
NOTESTS: 1
phpbb: 'master'
composer: 'php ../composer.phar'
epv: 'dev-epv-phpbb4'

name: PHP ${{ matrix.php }} - ${{ matrix.db }}
name: PHP ${{ matrix.php }} - ${{ matrix.db }}${{ matrix.phpbb == 'master' && ' - phpBB 4.0' || '' }}

steps:
- name: Update apt package index
Expand All @@ -40,7 +52,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
ref: ${{ matrix.phpbb }}
path: phpBB3

- name: Checkout extension
Expand All @@ -65,7 +77,7 @@ jobs:

- name: Setup EPV
if: ${{ env.EPV != 0 }}
run: composer require phpbb/epv:dev-master --dev --no-interaction --ignore-platform-reqs
run: ${{ matrix.composer }} require phpbb/epv:${{ matrix.epv }} --dev --no-interaction --ignore-platform-reqs
working-directory: ./phpBB3/phpBB

- name: Run code sniffer
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Click an image for the full size. See the [screenshot gallery](docs/images/scree

## Requirements

- phpBB 3.3.19 or later
- PHP 7.4 or later
- phpBB 3.3.19 or later, including phpBB 4.0 (tested on its 4.0.0-a3 development version)
- PHP 7.4 or later (phpBB 4.0 itself needs PHP 8.2 or later)

## Installation

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "A contact form that lets guests and members reach the board administrators by email, private message or forum post.",
"homepage": "https://www.phpbbmodders.com/",
"version": "1.6.0-dev",
"time": "2026-10-06",
"version": "1.6.1-dev",
"time": "2026-10-18",
"keywords": [
"phpbb",
"extension",
Expand All @@ -26,7 +26,7 @@
],
"require": {
"php": ">=7.4",
"phpbb/phpbb": ">=3.3.19,<4.0.0@dev",
"phpbb/phpbb": ">=3.3.19,<4.1.0@dev",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
Expand All @@ -35,7 +35,7 @@
"extra": {
"display-name": "Contact Admin",
"soft-require": {
"phpbb/phpbb": ">=3.3.19,<4.0.0@dev"
"phpbb/phpbb": ">=3.3.19,<4.1.0@dev"
},
"version-check": {
"host": "www.phpbb.com",
Expand Down
2 changes: 1 addition & 1 deletion controller/main_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function displayform()
// add an entry into the error log
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_CONTACT_EMAIL_INVALID', time());

$message = $this->language->lang('CONTACT_MAIL_DISABLED', '<a href="mailto:' . htmlspecialchars($this->config['board_contact']) . '">', '</a>');
$message = $this->language->lang('CONTACT_MAIL_DISABLED', '<a href="mailto:' . utf8_htmlspecialchars($this->config['board_contact']) . '">', '</a>');

return $this->helper->message($message);
}
Expand Down
8 changes: 4 additions & 4 deletions core/contactadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function __construct(
string $root_path,
string $php_ext,
array $contact_constants,
?service_collection $messenger_methods = null)
$messenger_methods = null)
{
$this->auth = $auth;
$this->cache = $cache;
Expand Down Expand Up @@ -205,7 +205,7 @@ public function contact_check($mode, $forum_id = false, $bot_id = false, $method
// add an entry into the error log
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_CONTACT_FORUM_INVALID', time(), [$forum_id]);

$message = $this->language->lang('CONTACT_DISABLED', '<a href="mailto:' . $this->config['board_contact'] . '">', '</a>');
$message = $this->language->lang('CONTACT_DISABLED', '<a href="mailto:' . utf8_htmlspecialchars($this->config['board_contact']) . '">', '</a>');

throw new http_exception(503, $message);
}
Expand Down Expand Up @@ -245,7 +245,7 @@ public function contact_check($mode, $forum_id = false, $bot_id = false, $method
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_CONTACT_BOT_INVALID', time(), [$bot_id]);

// show a message to the user
$message = $this->language->lang('CONTACT_DISABLED', '<a href="mailto:' . $this->config['board_contact'] . '">', '</a>');
$message = $this->language->lang('CONTACT_DISABLED', '<a href="mailto:' . utf8_htmlspecialchars($this->config['board_contact']) . '">', '</a>');

throw new http_exception(503, $message);
}
Expand Down Expand Up @@ -287,7 +287,7 @@ public function contact_check($mode, $forum_id = false, $bot_id = false, $method
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_CONTACT_NONE', time(), [$error]);

// show a message to the user
$message = $this->language->lang('CONTACT_DISABLED', '<a href="mailto:' . $this->config['board_contact'] . '">', '</a>');
$message = $this->language->lang('CONTACT_DISABLED', '<a href="mailto:' . utf8_htmlspecialchars($this->config['board_contact']) . '">', '</a>');

throw new http_exception(503, $message);
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/m1_update_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class m1_update_data extends \phpbb\db\migration\migration
{
static public function depends_on()
public static function depends_on()
{
return array('\phpbbmodders\contactadmin\migrations\version_100');
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/m2_update_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class m2_update_data extends \phpbb\db\migration\migration
{
static public function depends_on()
public static function depends_on()
{
return array('\phpbbmodders\contactadmin\migrations\m1_update_data');
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/m3_update_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class m3_update_data extends \phpbb\db\migration\migration
{
static public function depends_on()
public static function depends_on()
{
return ['\phpbbmodders\contactadmin\migrations\m2_update_data'];
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/m4_update_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class m4_update_data extends \phpbb\db\migration\migration
{
static public function depends_on()
public static function depends_on()
{
return ['\phpbbmodders\contactadmin\migrations\m3_update_data'];
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/version_100.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class version_100 extends \phpbb\db\migration\migration
{
static public function depends_on()
public static function depends_on()
{
return array('\phpbb\db\migration\data\v31x\v314rc1');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if U_CONTACTADMIN %}
<li class="rightside" data-last-responsive="true">
<a href="{{ U_CONTACTADMIN }}" role="menuitem">
<i class="icon fa-envelope fa-fw" aria-hidden="true"></i><span>{{ lang('CONTACT_US') }}</span>
<i class="icon o-icon o-icon-font fa-fw fa-envelope fas" aria-hidden="true"></i><span>{{ lang('CONTACT_US') }}</span>
</a>
</li>
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if U_CONTACTADMIN %}
<li data-last-responsive="true">
<a href="{{ U_CONTACTADMIN }}" role="menuitem">
<i class="icon fa-envelope fa-fw" aria-hidden="true"></i><span>{{ lang('CONTACT_US') }}</span>
<i class="icon o-icon o-icon-font fa-fw fa-envelope fas" aria-hidden="true"></i><span>{{ lang('CONTACT_US') }}</span>
</a>
</li>
{% endif %}
Loading