mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 06:07:26 +02:00
Fix some PHP 8.2 deprecations (#319)
* Define HTMLPurifier_Lexer::$_entity_parser property This fixes a PHP 8.2 deprecation. * Define HTMLPurifier_URIFilterHarness::$filter property This fixes a PHP 8.2 deprecation. * Define HTMLPurifier_AttrTransform_NameSync::$idDef property This fixes a PHP 8.2 deprecation. * Define HTMLPurifier_AttrTransform_NameSyncTest::$accumulator property This fixes a PHP 8.2 deprecation. * Define HTMLPurifier_AttrValidator_ErrorsTest::$language property This fixes a PHP 8.2 deprecation. * Define HTMLPurifier_ChildDef_List::$whitespace property This fixes a PHP 8.2 deprecation. * Do not modify incoming tokens in RemoveSpansWithoutAttributes Previously the undefined property `->markForDeletion` was added to the incoming tokens. This causes a deprecation in PHP 8.2. Fix this by storing to-be-deleted tokens inside SplObjectStorage. In PHP 8 a WeakMap would be preferable, as that prevents leaks if `handleEnd` is never called for the token.
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
class HTMLPurifier_AttrTransform_NameSyncTest extends HTMLPurifier_AttrTransformHarness
|
||||
{
|
||||
|
||||
/**
|
||||
* @type HTMLPurifier_IDAccumulator
|
||||
*/
|
||||
public $accumulator;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
@@ -3,6 +3,11 @@
|
||||
class HTMLPurifier_AttrValidator_ErrorsTest extends HTMLPurifier_ErrorsHarness
|
||||
{
|
||||
|
||||
/**
|
||||
* @type HTMLPurifier_Language
|
||||
*/
|
||||
public $language;
|
||||
|
||||
public function setup()
|
||||
{
|
||||
parent::setup();
|
||||
|
@@ -3,6 +3,11 @@
|
||||
class HTMLPurifier_URIFilterHarness extends HTMLPurifier_URIHarness
|
||||
{
|
||||
|
||||
/**
|
||||
* @type HTMLPurifier_URIFilter
|
||||
*/
|
||||
public $filter;
|
||||
|
||||
protected function assertFiltering($uri, $expect_uri = true)
|
||||
{
|
||||
$this->prepareURI($uri, $expect_uri);
|
||||
|
Reference in New Issue
Block a user