Make WordPress Core


Ignore:
Timestamp:
12/06/2021 11:06:40 AM (5 years ago)
Author:
SergeyBiryukov
Message:

KSES: Use the polyfilled PHP 8 string functions in _wp_kses_allow_pdf_objects():

  • str_contains()
  • str_ends_with()
  • str_starts_with()

Additionally, include a test for a PDF file in an <object> tag with an unsupported protocol.

Follow-up to [51963], [52039], [52040], [52304], [52309].

Props TobiasBg, ramonopoly.
See #54261.

File:
1 edited

Legend:

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

    r52309 r52326  
    15891589                                '',
    15901590                        ),
    1591                         'protocol relative url'                   => array(
     1591                        'protocol-relative url'                   => array(
    15921592                                '<object type="application/pdf" data="//example.org/foo.pdf" />',
     1593                                '',
     1594                        ),
     1595                        'unsupported protocol'                    => array(
     1596                                '<object type="application/pdf" data="ftp://example.org/foo.pdf" />',
    15931597                                '',
    15941598                        ),
Note: See TracChangeset for help on using the changeset viewer.