Skip to content

Commit b367184

Browse files
committed
add type check
1 parent 1c8ad90 commit b367184

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/HTMLPurifier/HTML5Config.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ public static function inherit(HTMLPurifier_Config $config)
6464
*/
6565
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)