Changeset 28882
- Timestamp:
- 06/28/2014 04:15:30 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r28858 r28882 442 442 function wp_extract_urls( $content ) { 443 443 preg_match_all( 444 "#((?:[\w-]+://?|[\w\d]+[.])[^\s()<>]+[.](?:\([\w\d]+\)|(?:[^`!()\[\]{};:'\".,<>?«»“”‘’\s]|(?:[:]\d+)?/?)+))#", 444 "#(" 445 . "(?: ([\w-]+:)?//? )" 446 . "[^\s()<>]+" 447 . "[.]" 448 . "(?:" 449 . "\([\w\d]+\) |" 450 . "(?:" 451 . "[^`!()\[\]{};:'\".,<>?«»“”‘’\s] |" 452 . "(?: [:]\d+ )?/?" 453 . ")+" 454 . ")" 455 . ")#x", 445 456 $content, 446 457 $post_links -
trunk/tests/phpunit/tests/functions.php
r25313 r28882 371 371 'http://woo.com/1,2,3,4,5,6/-1-2-3-4-/woo.html', 372 372 'http://this.com', 373 'http://127.0.0.1', 373 374 'http://www111.urwyeoweytwutreyytqytwetowteuiiu.com/?346236346326&2134362574863.437', 374 375 'http://wordpress-core/1,2,3,4,5,6/-1-2-3-4-/woo.html', … … 420 421 'http://türkiye.icom.museum', 421 422 'http://украина.icom.museum', 422 'http://việtnam.icom.museum' 423 'http://việtnam.icom.museum', 424 'ftp://127.0.0.1/' 423 425 ); 424 426 … … 427 429 428 430 http://this.com 431 432 http://127.0.0.1 429 433 430 434 http://www111.urwyeoweytwutreyytqytwetowteuiiu.com/?346236346326&2134362574863.437 … … 477 481 http://украина.icom.museum 478 482 http://việtnam.icom.museum 483 ftp://127.0.0.1/ 479 484 "; 480 485 … … 494 499 $blob ="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 495 500 incididunt ut labore http://woo.com/1,2,3,4,5,6/-1-2-3-4-/woo.html et dolore magna aliqua. 496 Ut http://this.com enim ad minim veniam, quis nostrud exercitation ullamco501 Ut http://this.com enim ad minim veniam, quis nostrud exercitation 16.06. to 18.06.2014 ullamco http://127.0.0.1 497 502 laboris nisi ut aliquip ex http://www111.urwyeoweytwutreyytqytwetowteuiiu.com/?346236346326&2134362574863.437 ea 498 503 commodo consequat. http://wordpress-core/1,2,3,4,5,6/-1-2-3-4-/woo.html Duis aute irure dolor in reprehenderit in voluptate … … 503 508 $this->assertNotEmpty( $urls ); 504 509 $this->assertInternalType( 'array', $urls ); 505 $this->assertCount( 7, $urls );506 $this->assertEquals( array_slice( $original_urls, 0, 7), $urls );510 $this->assertCount( 8, $urls ); 511 $this->assertEquals( array_slice( $original_urls, 0, 8 ), $urls ); 507 512 508 513 $blob = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 509 514 incididunt ut labore <a href="http://woo.com/1,2,3,4,5,6/-1-2-3-4-/woo.html">343462^</a> et dolore magna aliqua. 510 Ut <a href="http://this.com">&3640i6p1yi499</a> enim ad minim veniam, quis nostrud exercitation ullamco515 Ut <a href="http://this.com">&3640i6p1yi499</a> enim ad minim veniam, quis nostrud exercitation 16.06. to 18.06.2014 ullamco <a href="http://127.0.0.1">localhost</a> 511 516 laboris nisi ut aliquip ex <a href="http://www111.urwyeoweytwutreyytqytwetowteuiiu.com/?346236346326&2134362574863.437">343462^</a> ea 512 517 commodo consequat. <a href="http://wordpress-core/1,2,3,4,5,6/-1-2-3-4-/woo.html">343462^</a> Duis aute irure dolor in reprehenderit in voluptate … … 517 522 $this->assertNotEmpty( $urls ); 518 523 $this->assertInternalType( 'array', $urls ); 519 $this->assertCount( 7, $urls );520 $this->assertEquals( array_slice( $original_urls, 0, 7), $urls );524 $this->assertCount( 8, $urls ); 525 $this->assertEquals( array_slice( $original_urls, 0, 8 ), $urls ); 521 526 } 522 527 }
Note: See TracChangeset
for help on using the changeset viewer.