diff --git wordpress/wp-includes/comment.php wordpress/wp-includes/comment.php
index 4f60206..973e2a6 100644
|
|
function pingback($content, $post_ID) { |
1815 | 1815 | |
1816 | 1816 | $pung = get_pung($post_ID); |
1817 | 1817 | |
1818 | | // Variables |
1819 | | $ltrs = '\w'; |
1820 | | $gunk = '/#~:.?+=&%@!\-'; |
1821 | | $punc = '.:?\-'; |
1822 | | $any = $ltrs . $gunk . $punc; |
1823 | | |
1824 | 1818 | // Step 1 |
1825 | 1819 | // Parsing the post, external links (if any) are stored in the $post_links array |
1826 | | // This regexp comes straight from phpfreaks.com |
1827 | | // http://www.phpfreaks.com/quickcode/Extract_All_URLs_on_a_Page/15.php |
1828 | | preg_match_all("{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp); |
| 1820 | $post_links_temp = wp_extract_urls( $content ); |
1829 | 1821 | |
1830 | 1822 | // Step 2. |
1831 | 1823 | // Walking thru the links array |
… |
… |
function pingback($content, $post_ID) { |
1836 | 1828 | // http://dummy-weblog.org/post.php |
1837 | 1829 | // We don't wanna ping first and second types, even if they have a valid <link/> |
1838 | 1830 | |
1839 | | foreach ( (array) $post_links_temp[0] as $link_test ) : |
| 1831 | foreach ( (array) $post_links_temp as $link_test ) : |
1840 | 1832 | if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself |
1841 | 1833 | && !is_local_attachment($link_test) ) : // Also, let's never ping local attachments. |
1842 | 1834 | if ( $test = @parse_url($link_test) ) { |
diff --git wordpress/wp-includes/functions.php wordpress/wp-includes/functions.php
index 5e0841c..76bf0b1 100644
|
|
function xmlrpc_removepostdata( $content ) { |
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
| 396 | * Use RegEx to extract URLs from arbitrary content |
| 397 | * |
| 398 | * @since 3.6.0 |
| 399 | * |
| 400 | * @param string $content |
| 401 | * @return array URLs found in passed string |
| 402 | */ |
| 403 | function wp_extract_urls( $content ) { |
| 404 | preg_match_all( |
| 405 | "#((?:[\w-]+://?|[\w\d]+[.])[^\s()<>]+[.](?:\([\w\d]+\)|(?:[^`!()\[\]{};:'\".,<>?«»“”‘’\s]|(?:[:]\d+)?/?)+))#", |
| 406 | $content, |
| 407 | $post_links |
| 408 | ); |
| 409 | |
| 410 | $post_links = array_unique( array_map( 'html_entity_decode', $post_links[0] ) ); |
| 411 | |
| 412 | return array_values( $post_links ); |
| 413 | } |
| 414 | |
| 415 | /** |
396 | 416 | * Check content for video and audio links to add as enclosures. |
397 | 417 | * |
398 | 418 | * Will not add enclosures that have already been added and will |
… |
… |
function do_enclose( $content, $post_ID ) { |
417 | 437 | |
418 | 438 | $pung = get_enclosed( $post_ID ); |
419 | 439 | |
420 | | $ltrs = '\w'; |
421 | | $gunk = '/#~:.?+=&%@!\-'; |
422 | | $punc = '.:?\-'; |
423 | | $any = $ltrs . $gunk . $punc; |
424 | | |
425 | | preg_match_all( "{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp ); |
| 440 | $post_links_temp = wp_extract_urls( $content ); |
426 | 441 | |
427 | 442 | foreach ( $pung as $link_test ) { |
428 | | if ( !in_array( $link_test, $post_links_temp[0] ) ) { // link no longer in post |
| 443 | if ( !in_array( $link_test, $post_links_temp ) ) { // link no longer in post |
429 | 444 | $mids = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, like_escape( $link_test ) . '%') ); |
430 | 445 | foreach ( $mids as $mid ) |
431 | 446 | delete_metadata_by_mid( 'post', $mid ); |
432 | 447 | } |
433 | 448 | } |
434 | 449 | |
435 | | foreach ( (array) $post_links_temp[0] as $link_test ) { |
| 450 | foreach ( (array) $post_links_temp as $link_test ) { |
436 | 451 | if ( !in_array( $link_test, $pung ) ) { // If we haven't pung it already |
437 | 452 | $test = @parse_url( $link_test ); |
438 | 453 | if ( false === $test ) |
… |
… |
function get_temp_dir() { |
1437 | 1452 | /** |
1438 | 1453 | * Determine if a directory is writable. |
1439 | 1454 | * |
1440 | | * This function is used to work around certain ACL issues |
| 1455 | * This function is used to work around certain ACL issues |
1441 | 1456 | * in PHP primarily affecting Windows Servers. |
1442 | 1457 | * |
1443 | 1458 | * @see win_is_writable() |
… |
… |
function wp_is_writable( $path ) { |
1457 | 1472 | /** |
1458 | 1473 | * Workaround for Windows bug in is_writable() function |
1459 | 1474 | * |
1460 | | * PHP has issues with Windows ACL's for determine if a |
| 1475 | * PHP has issues with Windows ACL's for determine if a |
1461 | 1476 | * directory is writable or not, this works around them by |
1462 | 1477 | * checking the ability to open files rather than relying |
1463 | 1478 | * upon PHP to interprate the OS ACL. |