From 9d9c30ce34b8e7a70e9124c259868e818aa8109f Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Sun, 18 Oct 2026 20:51:05 -0500 Subject: [PATCH 1/4] Support phpBB 4.0 and start 1.6.1-dev - composer.json: version 1.6.1-dev, and phpBB >=3.3.19,<4.1.0@dev (was <4.0.0@dev) in require and soft-require. - The header and footer "Contact us" links showed an empty box instead of the envelope on phpBB 4.0, whose icons need Font Awesome 6's classes. They now carry both sets of classes, which works on 3.3 and 4.0. - tests.yml also runs the basic checks (code sniffer, EPV) on phpBB's master branch with PHP 8.2. The phpBB 3.3 job keeps its check name. - README requirements list phpBB 4.0, and lint.yml's comment says what tests.yml covers. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/lint.yml | 4 ++-- .github/workflows/tests.yml | 12 +++++++++--- README.md | 4 ++-- composer.json | 8 ++++---- .../event/overall_footer_teamlink_after.html | 2 +- .../event/overall_header_navigation_append.html | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ef48cd3..2b48d51 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 897f464..eaf655c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: @@ -26,11 +25,18 @@ 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' + # phpBB 4.0 (the master branch) with its minimum PHP + - php: '8.2' + db: 'none' + NOTESTS: 1 + phpbb: 'master' - name: PHP ${{ matrix.php }} - ${{ matrix.db }} + name: PHP ${{ matrix.php }} - ${{ matrix.db }}${{ matrix.phpbb == 'master' && ' - phpBB 4.0' || '' }} steps: - name: Update apt package index @@ -40,7 +46,7 @@ jobs: uses: actions/checkout@v4 with: repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} + ref: ${{ matrix.phpbb }} path: phpBB3 - name: Checkout extension diff --git a/README.md b/README.md index d17421c..28373ea 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/composer.json b/composer.json index 3be5d84..886b299 100644 --- a/composer.json +++ b/composer.json @@ -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", @@ -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": { @@ -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", diff --git a/styles/prosilver/template/event/overall_footer_teamlink_after.html b/styles/prosilver/template/event/overall_footer_teamlink_after.html index 25df39c..cddad60 100644 --- a/styles/prosilver/template/event/overall_footer_teamlink_after.html +++ b/styles/prosilver/template/event/overall_footer_teamlink_after.html @@ -1,7 +1,7 @@ {% if U_CONTACTADMIN %}
  • - {{ lang('CONTACT_US') }} + {{ lang('CONTACT_US') }}
  • {% endif %} diff --git a/styles/prosilver/template/event/overall_header_navigation_append.html b/styles/prosilver/template/event/overall_header_navigation_append.html index 35ac6b4..89e38e0 100644 --- a/styles/prosilver/template/event/overall_header_navigation_append.html +++ b/styles/prosilver/template/event/overall_header_navigation_append.html @@ -1,7 +1,7 @@ {% if U_CONTACTADMIN %}
  • - {{ lang('CONTACT_US') }} + {{ lang('CONTACT_US') }}
  • {% endif %} From d0483b3d779301aa7f144e0b233e3ec0fb6ce26e Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Sun, 18 Oct 2026 20:56:01 -0500 Subject: [PATCH 2/4] Install EPV's phpBB 4.0 branch for the phpBB 4.0 check EPV's dev-master needs symfony/yaml 6 or older, which phpBB 4.0's Symfony 7 packages rule out, so the new phpBB 4.0 job failed to install it. That job now installs phpbb/epv:dev-epv-phpbb4 with phpBB's own composer.phar, as phpbb-extensions/test-framework does for phpBB 4.0. The phpBB 3.3 job's command is unchanged. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/tests.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eaf655c..67db398 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,11 +30,17 @@ jobs: db: 'none' NOTESTS: 1 phpbb: '3.3.x' - # phpBB 4.0 (the master branch) with its minimum PHP + 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 }}${{ matrix.phpbb == 'master' && ' - phpBB 4.0' || '' }} @@ -71,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 From 09a0b80a5e2e94e6d70562e0aeba06f8a8f7c02a Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Sun, 18 Oct 2026 20:59:13 -0500 Subject: [PATCH 3/4] Pass phpBB 4.0's code sniffer - The five released migrations declared depends_on() as "static public"; phpBB 4.0's sniffer requires "public static". Only the modifier order changes, which PHP treats the same, so migration names, dependencies and data are unchanged. - The core class's optional messenger methods argument used the ?type shortcut, which phpBB 4.0's sniffer rejects; its union-type form needs PHP 8.0, so the argument is now untyped, with its type in the docblock. Co-Authored-By: Claude Opus 5.5 --- core/contactadmin.php | 2 +- migrations/m1_update_data.php | 2 +- migrations/m2_update_data.php | 2 +- migrations/m3_update_data.php | 2 +- migrations/m4_update_data.php | 2 +- migrations/version_100.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/contactadmin.php b/core/contactadmin.php index c7d0157..3b322ae 100644 --- a/core/contactadmin.php +++ b/core/contactadmin.php @@ -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; diff --git a/migrations/m1_update_data.php b/migrations/m1_update_data.php index 3f20633..f8bee55 100644 --- a/migrations/m1_update_data.php +++ b/migrations/m1_update_data.php @@ -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'); } diff --git a/migrations/m2_update_data.php b/migrations/m2_update_data.php index d4aa0e6..b3b2699 100644 --- a/migrations/m2_update_data.php +++ b/migrations/m2_update_data.php @@ -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'); } diff --git a/migrations/m3_update_data.php b/migrations/m3_update_data.php index 739a2d1..1b8fb8a 100644 --- a/migrations/m3_update_data.php +++ b/migrations/m3_update_data.php @@ -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']; } diff --git a/migrations/m4_update_data.php b/migrations/m4_update_data.php index 96b1b0d..a228a90 100644 --- a/migrations/m4_update_data.php +++ b/migrations/m4_update_data.php @@ -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']; } diff --git a/migrations/version_100.php b/migrations/version_100.php index 43eaa53..8decec6 100644 --- a/migrations/version_100.php +++ b/migrations/version_100.php @@ -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'); } From eb7799494778b4eaace29e9f12b7a73104df2099 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Sun, 18 Oct 2026 21:02:09 -0500 Subject: [PATCH 4/4] Use utf8_htmlspecialchars() for the board contact links EPV flags plain htmlspecialchars() in the "email is disabled" message. That link and the three similar ones in the core class's error messages, which had no escaping at all, now use phpBB's utf8_htmlspecialchars(). Co-Authored-By: Claude Opus 5.5 --- controller/main_controller.php | 2 +- core/contactadmin.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/main_controller.php b/controller/main_controller.php index d6e406e..b7cc88a 100644 --- a/controller/main_controller.php +++ b/controller/main_controller.php @@ -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', '', ''); + $message = $this->language->lang('CONTACT_MAIL_DISABLED', '', ''); return $this->helper->message($message); } diff --git a/core/contactadmin.php b/core/contactadmin.php index 3b322ae..236de2d 100644 --- a/core/contactadmin.php +++ b/core/contactadmin.php @@ -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', '', ''); + $message = $this->language->lang('CONTACT_DISABLED', '', ''); throw new http_exception(503, $message); } @@ -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', '', ''); + $message = $this->language->lang('CONTACT_DISABLED', '', ''); throw new http_exception(503, $message); } @@ -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', '', ''); + $message = $this->language->lang('CONTACT_DISABLED', '', ''); throw new http_exception(503, $message); }