mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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>',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user