Skip to content

Commit 07805f9

Browse files
committed
Add support for phpBB v4
1 parent 6566c47 commit 07805f9

File tree

5 files changed

+20
-27
lines changed

5 files changed

+20
-27
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ env:
1111
IMAGE_ICC: 1
1212
EPV: 1
1313
EXECUTABLE_FILES: 1
14-
PHPBB_BRANCH: 3.3.x
14+
PHPBB_BRANCH: master
1515

1616
jobs:
1717
basic-tests:
1818
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }}
1919
name: php ${{ matrix.php-version }}, none none
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-latest
2121
env:
2222
PHP_VERSION: ${{ matrix.php-version }}
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
php-version: ['7.4']
26+
php-version: ['8.1']
2727
steps:
2828
- name: Checkout phpBB
2929
uses: actions/checkout@v5
@@ -107,7 +107,7 @@ jobs:
107107
mysql-tests:
108108
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }}
109109
name: php ${{ matrix.php-version }}, ${{ matrix.db-type }} ${{ matrix.db-version }}
110-
runs-on: ubuntu-22.04
110+
runs-on: ubuntu-latest
111111
services:
112112
mysql:
113113
image: ${{ (matrix.db-type == 'mysql' || matrix.db-type == 'mariadb') && matrix.db-type || 'mariadb' }}:${{ (matrix.db-type == 'mysql' || matrix.db-type == 'mariadb' && matrix.db-version != 'none') && matrix.db-version || 'latest' }}
@@ -129,15 +129,9 @@ jobs:
129129
fail-fast: false
130130
matrix:
131131
include:
132-
- php-version: '7.4'
132+
- php-version: '8.1'
133133
db-type: 'mysql'
134-
db-version: '8.0'
135-
- php-version: '7.4'
136-
db-type: 'mariadb'
137-
db-version: '10.5'
138-
- php-version: '8.0'
139-
db-type: 'mariadb'
140-
db-version: '10.5'
134+
db-version: '5.7'
141135
- php-version: '8.1'
142136
db-type: 'mariadb'
143137
db-version: '10.6'
@@ -222,7 +216,7 @@ jobs:
222216
postgresql-tests:
223217
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }}
224218
name: php ${{ matrix.php-version }}, ${{ matrix.db-type }} ${{ matrix.db-version }}
225-
runs-on: ubuntu-22.04
219+
runs-on: ubuntu-latest
226220
services:
227221
postgres:
228222
image: ${{ (matrix.db-type == 'postgres') && matrix.db-type || 'postgres' }}:${{ (matrix.db-type == 'postgres' && matrix.db-version != 'none') && matrix.db-version || 'alpine' }}
@@ -245,12 +239,12 @@ jobs:
245239
fail-fast: false
246240
matrix:
247241
include:
248-
- php-version: '7.4'
242+
- php-version: '8.1'
249243
db-type: 'postgres'
250-
db-version: '16-alpine'
244+
db-version: '17-alpine'
251245
- php-version: '8.4'
252246
db-type: 'postgres'
253-
db-version: '17-alpine'
247+
db-version: '18-alpine'
254248
steps:
255249
- name: Checkout phpBB
256250
uses: actions/checkout@v5

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "phpbb-extension",
44
"description": "Markdown extension for phpBB",
55
"homepage": "https://github.com/AlfredoRamos/phpbb-ext-markdown",
6-
"version": "1.5.0",
7-
"time": "2025-09-12",
6+
"version": "2.0.0-dev",
7+
"time": "2025-09-30",
88
"keywords": [
99
"phpbb",
1010
"extension",
@@ -23,7 +23,7 @@
2323
}
2424
],
2525
"require": {
26-
"php": "^7.4.0 || ^8.0.0",
26+
"php": "^8.1.0",
2727
"composer/installers": "^2.2.0"
2828
},
2929
"require-dev": {
@@ -36,7 +36,7 @@
3636
"extra": {
3737
"display-name": "Markdown",
3838
"soft-require": {
39-
"phpbb/phpbb": "~3.3.2"
39+
"phpbb/phpbb": "~4.0.0"
4040
},
4141
"version-check": {
4242
"host": "alfredoramos.mx",

ext.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
class ext extends base
1515
{
1616
/**
17-
* Check whether or not the extension can be enabled.
18-
*
19-
* @return bool
20-
*/
17+
* {@inheritdoc}
18+
*/
2119
public function is_enableable()
2220
{
23-
return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=');
21+
return phpbb_version_compare(PHPBB_VERSION, '4.0.0-a1-dev', '>='); // TODO: Use stable version
2422
}
2523
}

styles/prosilver/theme/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ h6.markdown {
6969
table.markdown {
7070
margin-top: 1em;
7171
margin-bottom: 1em;
72+
border-spacing: 0;
7273
}
7374
table.markdown,
7475
table.markdown th,

tests/functional/markdown_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ public function test_inline_spoiler()
363363
));
364364

365365
$expected = <<<EOT
366-
<p>This is a Reddit-style <span class="spoiler markdown" onclick="removeAttribute('style')" style="background:#444;color:transparent">spoiler</span>.<br>
367-
This is a Discord-style <span class="spoiler markdown" onclick="removeAttribute('style')" style="background:#444;color:transparent">spoiler</span>.</p>
366+
<p>This is a Reddit-style <span class="spoiler markdown" onclick="this.removeAttribute('style')" style="background:#444;color:transparent">spoiler</span>.<br>
367+
This is a Discord-style <span class="spoiler markdown" onclick="this.removeAttribute('style')" style="background:#444;color:transparent">spoiler</span>.</p>
368368
EOT;
369369

370370
$result = $crawler->filter(sprintf(

0 commit comments

Comments
 (0)