WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/09/2015 11:54:24 PM (6 years ago)
Author:
johnbillion
Message:

Formatting: Don't make links inside <script> and <style> tags clickable.

Fixes #30162
Props ninos-ego, adamsilverstein

File:
1 edited

Legend:

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

    r30514 r35847  
    373373        $this->assertEquals( $html, make_clickable( $html ) );
    374374    }
     375
     376    /**
     377     * @dataProvider data_script_and_style_tags
     378     * @ticket 30162
     379     */
     380    public function test_dont_link_script_and_style_tags( $tag ) {
     381        $this->assertEquals( $tag, make_clickable( $tag ) );
     382    }
     383
     384    public function data_script_and_style_tags() {
     385        return array(
     386            array(
     387                '<script>http://wordpress.org</script>',
     388            ),
     389            array(
     390                '<style>http://wordpress.org</style>',
     391            ),
     392            array(
     393                '<script type="text/javascript">http://wordpress.org</script>',
     394            ),
     395            array(
     396                '<style type="text/css">http://wordpress.org</style>',
     397            ),
     398        );
     399    }
     400
    375401}
Note: See TracChangeset for help on using the changeset viewer.