Changeset 35847
- Timestamp:
- 12/09/2015 11:54:24 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r35813 r35847 2196 2196 foreach ( $textarr as $piece ) { 2197 2197 2198 if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) )2198 if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) || preg_match( '|^<script[\s>]|i', $piece ) || preg_match( '|^<style[\s>]|i', $piece ) ) 2199 2199 $nested_code_pre++; 2200 elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre)2200 elseif ( $nested_code_pre && ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) || '</script>' === strtolower( $piece ) || '</style>' === strtolower( $piece ) ) ) 2201 2201 $nested_code_pre--; 2202 2202 -
trunk/tests/phpunit/tests/formatting/MakeClickable.php
r30514 r35847 373 373 $this->assertEquals( $html, make_clickable( $html ) ); 374 374 } 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 375 401 }
Note: See TracChangeset
for help on using the changeset viewer.