WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/29/2019 09:28:57 PM (7 months ago)
Author:
peterwilsoncc
Message:

Customize: Remove wp_targeted_link_rel pre-save filter from change-sets.

The pre-save filters added to links in [43732] could invalidate JSON data when saving Customizer change-sets.

This removes the filters when saving and publishing change-sets.

Props peterwilsoncc, nikeo for testing.
See #45292.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php

    r44691 r44714  
    8484        $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
    8585    }
     86
     87    /**
     88     * Ensure default content filters are added.
     89     *
     90     * @ticket 45292.
     91     */
     92    public function test_wp_targeted_link_rel_filters_run() {
     93        $content  = '<p>Links: <a href="/" target="_blank">No rel</a></p>';
     94        $expected = '<p>Links: <a href="/" target="_blank" rel="noopener noreferrer">No rel</a></p>';
     95
     96        $post = $this->factory()->post->create_and_get(
     97            array(
     98                'post_content' => $content,
     99            )
     100        );
     101
     102        $this->assertEquals( $expected, $post->post_content );
     103    }
    86104}
Note: See TracChangeset for help on using the changeset viewer.