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

Fixes #30162
Props ninos-ego, adamsilverstein


git-svn-id: https://develop.svn.wordpress.org/trunk@35847 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2015-12-09 23:54:24 +00:00
parent 08f67db8a3
commit c2f597280b
2 changed files with 28 additions and 2 deletions
@@ -372,4 +372,30 @@ class Tests_Formatting_MakeClickable extends WP_UnitTestCase {
href='mailto:someone@example.com'>someone@example.com</a>";
$this->assertEquals( $html, make_clickable( $html ) );
}
/**
* @dataProvider data_script_and_style_tags
* @ticket 30162
*/
public function test_dont_link_script_and_style_tags( $tag ) {
$this->assertEquals( $tag, make_clickable( $tag ) );
}
public function data_script_and_style_tags() {
return array(
array(
'<script>http://wordpress.org</script>',
),
array(
'<style>http://wordpress.org</style>',
),
array(
'<script type="text/javascript">http://wordpress.org</script>',
),
array(
'<style type="text/css">http://wordpress.org</style>',
),
);
}
}