WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/20/2018 09:34:15 PM (20 months ago)
Author:
SergeyBiryukov
Message:

Formatting: Avoid a PHP 7.2 warning in wp_kses_attr() when one of $allowedtags elements is an uncountable value.

Props andrei0x309, soulseekah, SergeyBiryukov.
Fixes #43312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/kses.php

    r42343 r42860  
    723723        $this->assertEquals( "<{$element} title=\"foo\">", wp_kses_attr( $element, $attribute, array( 'foo' => array( 'title' => true ) ), array() ) );
    724724    }
     725
     726    /**
     727     * @ticket 43312
     728     */
     729    function test_wp_kses_attr_no_attributes_allowed_with_false() {
     730        $element   = 'foo';
     731        $attribute = 'title="foo" class="bar"';
     732
     733        $this->assertEquals( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => false ), array() ) );
     734    }
    725735}
Note: See TracChangeset for help on using the changeset viewer.