Make WordPress Core


Ignore:
Timestamp:
06/18/2021 03:51:26 PM (4 years ago)
Author:
SergeyBiryukov
Message:

REST API: Decode single and double quote entities in widget names and descriptions.

Follow-up to [51174], [51175].

Props ocean90, ramonopoly.
Fixes #53407.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-widget-types-controller.php

    r51174 r51183  
    207207        wp_register_sidebar_widget(
    208208            $widget_id,
    209             'Legacy ‑ Archive ‑ Widget',
     209            '‘Legacy ‑ Archive ‑ Widget’',
    210210            function() {},
    211211            array(
    212                 'description' => 'A great & interesting archive of your site’s posts!',
     212                'description' => '“A great & interesting archive of your site’s posts!”',
    213213            )
    214214        );
     
    216216        $response = rest_get_server()->dispatch( $request );
    217217        $data     = $response->get_data();
    218         $this->assertSame( 'Legacy ‑ Archive ‑ Widget', $data['name'] );
    219         $this->assertSame( 'A great & interesting archive of your site’s posts!', $data['description'] );
     218        $this->assertSame( '‘Legacy ‑ Archive ‑ Widget’', $data['name'] );
     219        $this->assertSame( '“A great & interesting archive of your site’s posts!”', $data['description'] );
    220220    }
    221221
Note: See TracChangeset for help on using the changeset viewer.