]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/comment.php
Wordpress 3.5.2
[autoinstalls/wordpress.git] / wp-includes / comment.php
index 7a8f71cfd470b59c980e7ca2999c4ce0283c232d..5476b930c7e098fe72748acf684f32cfd40b2246 100644 (file)
@@ -290,13 +290,13 @@ class WP_Comment_Query {
                                'user_id',
                        );
                        if ( ! empty( $this->query_vars['meta_key'] ) ) {
                                'user_id',
                        );
                        if ( ! empty( $this->query_vars['meta_key'] ) ) {
-                               $allowed_keys[] = $q['meta_key'];
+                               $allowed_keys[] = $this->query_vars['meta_key'];
                                $allowed_keys[] = 'meta_value';
                                $allowed_keys[] = 'meta_value_num';
                        }
                        $ordersby = array_intersect( $ordersby, $allowed_keys );
                        foreach ( $ordersby as $key => $value ) {
                                $allowed_keys[] = 'meta_value';
                                $allowed_keys[] = 'meta_value_num';
                        }
                        $ordersby = array_intersect( $ordersby, $allowed_keys );
                        foreach ( $ordersby as $key => $value ) {
-                               if ( $value == $q['meta_key'] || $value == 'meta_value' ) {
+                               if ( $value == $this->query_vars['meta_key'] || $value == 'meta_value' ) {
                                        $ordersby[ $key ] = "$wpdb->commentmeta.meta_value";
                                } elseif ( $value == 'meta_value_num' ) {
                                        $ordersby[ $key ] = "$wpdb->commentmeta.meta_value+0";
                                        $ordersby[ $key ] = "$wpdb->commentmeta.meta_value";
                                } elseif ( $value == 'meta_value_num' ) {
                                        $ordersby[ $key ] = "$wpdb->commentmeta.meta_value+0";
@@ -1661,7 +1661,7 @@ function discover_pingback_server_uri( $url, $deprecated = '' ) {
        if ( 0 === strpos($url, $uploads_dir['baseurl']) )
                return false;
 
        if ( 0 === strpos($url, $uploads_dir['baseurl']) )
                return false;
 
-       $response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
+       $response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) );
 
        if ( is_wp_error( $response ) )
                return false;
 
        if ( is_wp_error( $response ) )
                return false;
@@ -1674,7 +1674,7 @@ function discover_pingback_server_uri( $url, $deprecated = '' ) {
                return false;
 
        // Now do a GET since we're going to look in the html headers (and we're sure its not a binary file)
                return false;
 
        // Now do a GET since we're going to look in the html headers (and we're sure its not a binary file)
-       $response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
+       $response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) );
 
        if ( is_wp_error( $response ) )
                return false;
 
        if ( is_wp_error( $response ) )
                return false;
@@ -1908,6 +1908,7 @@ function trackback($trackback_url, $title, $excerpt, $ID) {
 
        $options = array();
        $options['timeout'] = 4;
 
        $options = array();
        $options['timeout'] = 4;
+       $options['reject_unsafe_urls'] = true;
        $options['body'] = array(
                'title' => $title,
                'url' => get_permalink($ID),
        $options['body'] = array(
                'title' => $title,
                'url' => get_permalink($ID),
@@ -1951,6 +1952,37 @@ function weblog_ping($server = '', $path = '') {
                $client->query('weblogUpdates.ping', get_option('blogname'), $home);
 }
 
                $client->query('weblogUpdates.ping', get_option('blogname'), $home);
 }
 
+/**
+ * Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI
+ *
+ * @since 3.5.1
+ * @see wp_http_validate_url()
+ *
+ * @param string $source_uri
+ * @return string
+ */
+function pingback_ping_source_uri( $source_uri ) {
+       return (string) wp_http_validate_url( $source_uri );
+}
+
+/**
+ * Default filter attached to xmlrpc_pingback_error.
+ *
+ * Returns a generic pingback error code unless the error code is 48,
+ * which reports that the pingback is already registered.
+ *
+ * @since 3.5.1
+ * @link http://www.hixie.ch/specs/pingback/pingback#TOC3
+ *
+ * @param IXR_Error $ixr_error
+ * @return IXR_Error
+ */
+function xmlrpc_pingback_error( $ixr_error ) {
+       if ( $ixr_error->code === 48 )
+               return $ixr_error;
+       return new IXR_Error( 0, '' );
+}
+
 //
 // Cache
 //
 //
 // Cache
 //