Skip to content

Commit a564d2a

Browse files
authored
PHP 8.4 support (#84)
1 parent 15fcb5a commit a564d2a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
matrix:
1212
operating-system: ['ubuntu-latest']
1313
php-versions:
14+
- '8.4'
15+
- '8.3'
1416
- '8.2'
1517
- '8.1'
1618
- '8.0'

library/HTMLPurifier/HTML5Config.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,16 @@ public static function inherit(HTMLPurifier_Config $config)
6060

6161
/**
6262
* @param HTMLPurifier_ConfigSchema $schema
63-
* @param HTMLPurifier_PropertyList $parent OPTIONAL
63+
* @param HTMLPurifier_PropertyList|null $parent OPTIONAL
6464
*/
65-
public function __construct(HTMLPurifier_ConfigSchema $schema, HTMLPurifier_PropertyList $parent = null)
65+
public function __construct(HTMLPurifier_ConfigSchema $schema, $parent = null)
6666
{
67+
if ($parent && !$parent instanceof HTMLPurifier_PropertyList) {
68+
throw new InvalidArgumentException(
69+
'Argument #2 ($parent) passed to ' . __METHOD__ . '() must be an instance of HTMLPurifier_PropertyList or null'
70+
);
71+
}
72+
6773
// ensure 'HTML5' is among allowed 'HTML.Doctype' values
6874
$doctypeConfig = $schema->info['HTML.Doctype'];
6975

0 commit comments

Comments
 (0)