Changeset 45408
- Timestamp:
- 05/25/2019 12:04:28 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r45348 r45408 3041 3041 // Don't run (more expensive) regex if no links with targets. 3042 3042 if ( stripos( $text, 'target' ) !== false && stripos( $text, '<a ' ) !== false ) { 3043 $text = preg_replace_callback( '|<a\s([^>]*target\s*=[^>]*)>|i', 'wp_targeted_link_rel_callback', $text ); 3043 if ( ! is_serialized( $text ) ) { 3044 $text = preg_replace_callback( '|<a\s([^>]*target\s*=[^>]*)>|i', 'wp_targeted_link_rel_callback', $text ); 3045 } 3044 3046 } 3045 3047 -
trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php
r45348 r45408 128 128 $this->assertEquals( $expected, wp_targeted_link_rel( $content ) ); 129 129 } 130 131 /** 132 * Ensure entirely serialized content is ignored. 133 * 134 * @ticket 46402. 135 */ 136 public function test_ignore_entirely_serialized_content() { 137 $content = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}'; 138 $expected = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}'; 139 $this->assertEquals( $expected, wp_targeted_link_rel( $content ) ); 140 } 141 130 142 }
Note: See TracChangeset
for help on using the changeset viewer.