Changeset 24480 for trunk/wp-includes/comment.php
- Timestamp:
- 06/21/2013 06:07:47 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/comment.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r24301 r24480 1659 1659 return false; 1660 1660 1661 $response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );1661 $response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) ); 1662 1662 1663 1663 if ( is_wp_error( $response ) ) … … 1672 1672 1673 1673 // Now do a GET since we're going to look in the html headers (and we're sure it's not a binary file) 1674 $response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );1674 $response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) ); 1675 1675 1676 1676 if ( is_wp_error( $response ) ) … … 1907 1907 $options = array(); 1908 1908 $options['timeout'] = 4; 1909 $options['reject_unsafe_urls'] = true; 1909 1910 $options['body'] = array( 1910 1911 'title' => $title, … … 1954 1955 * 1955 1956 * @since 3.5.1 1957 * @see wp_http_validate_url() 1956 1958 * 1957 1959 * @param string $source_uri … … 1959 1961 */ 1960 1962 function pingback_ping_source_uri( $source_uri ) { 1961 $uri = esc_url_raw( $source_uri, array( 'http', 'https' ) ); 1962 if ( ! $uri ) 1963 return ''; 1964 1965 $parsed_url = @parse_url( $uri ); 1966 if ( ! $parsed_url ) 1967 return ''; 1968 1969 if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) ) 1970 return ''; 1971 1972 if ( false !== strpos( $parsed_url['host'], ':' ) ) 1973 return ''; 1974 1975 $parsed_home = @parse_url( get_option( 'home' ) ); 1976 1977 $same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] ); 1978 1979 if ( ! $same_host ) { 1980 $host = trim( $parsed_url['host'], '.' ); 1981 if ( preg_match( '#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $host ) ) { 1982 $ip = $host; 1983 } else { 1984 $ip = gethostbyname( $host ); 1985 if ( $ip === $host ) // Error condition for gethostbyname() 1986 $ip = false; 1987 } 1988 if ( $ip ) { 1989 if ( '127.0.0.1' === $ip ) 1990 return ''; 1991 $parts = array_map( 'intval', explode( '.', $ip ) ); 1992 if ( 10 === $parts[0] ) 1993 return ''; 1994 if ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] ) 1995 return ''; 1996 if ( 192 === $parts[0] && 168 === $parts[1] ) 1997 return ''; 1998 } 1999 } 2000 2001 if ( empty( $parsed_url['port'] ) ) 2002 return $uri; 2003 2004 $port = $parsed_url['port']; 2005 if ( 80 === $port || 443 === $port || 8080 === $port ) 2006 return $uri; 2007 2008 if ( $parsed_home && $same_host && $parsed_home['port'] === $port ) 2009 return $uri; 2010 2011 return ''; 1963 return (string) wp_http_validate_url( $source_uri ); 2012 1964 } 2013 1965
Note: See TracChangeset
for help on using the changeset viewer.