diff --git a/projects/plugins/wpcomsh/changelog/fix-content-clickable b/projects/plugins/wpcomsh/changelog/fix-content-clickable new file mode 100644 index 0000000000000..6da2dba1ca6ba --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/fix-content-clickable @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix function that add links to URLs in the page when having HTML attributes with "<" in the value diff --git a/projects/plugins/wpcomsh/tests/test-wpcomsh.php b/projects/plugins/wpcomsh/tests/test-wpcomsh.php index 524d985812021..0357626a8f2c7 100644 --- a/projects/plugins/wpcomsh/tests/test-wpcomsh.php +++ b/projects/plugins/wpcomsh/tests/test-wpcomsh.php @@ -29,6 +29,7 @@ public function test_wpcomsh_make_content_clickable() { $div_skip = '
https://wp.com' . // Made clickable even if it starts with `'; // Don't make clickable if it's inside a tag inside an attribute. $this->assertEquals( $expected_output, wpcomsh_make_content_clickable( $original_content ) ); } diff --git a/projects/plugins/wpcomsh/wpcomsh.php b/projects/plugins/wpcomsh/wpcomsh.php index 92bacc4441469..1c609132d8dc6 100644 --- a/projects/plugins/wpcomsh/wpcomsh.php +++ b/projects/plugins/wpcomsh/wpcomsh.php @@ -387,7 +387,7 @@ function wpcomsh_make_content_clickable( $content ) { // don't look in , , and // usein support docs where linkifying // breaks shortcodes, etc. - $_split = preg_split( '/(<[^<>]+>)/i', $content, -1, PREG_SPLIT_DELIM_CAPTURE ); + $_split = preg_split( '/(<[^>]+>)/i', $content, -1, PREG_SPLIT_DELIM_CAPTURE ); $end = ''; $out = ''; $combine = '';