Ticket #6934: 6934.diff

File 6934.diff, 1.8 kB (added by xknown, 7 months ago)
  • wp-includes/post.php

    old new  
    12601260                        if ( $wp_error ) 
    12611261                                return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error); 
    12621262                        else 
    1263                                 return 0;       
     1263                                return 0; 
    12641264                } 
    12651265                $post_ID = (int) $wpdb->insert_id; 
    12661266 
     
    19241924        $where = "$exclusions $inclusions "; 
    19251925        if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) { 
    19261926                $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )"; 
    1927                  
    1928                 // meta_key and met_value might be slashed  
     1927 
     1928                // meta_key and met_value might be slashed 
    19291929                $meta_key = stripslashes($meta_key); 
    19301930                $meta_value = stripslashes($meta_value); 
    19311931                if ( ! empty( $meta_key ) ) 
     
    20522052                while ($post_name_check) { 
    20532053                        $alt_post_name = $post_name . "-$suffix"; 
    20542054                        // expected_slashed ($alt_post_name, $post_name) 
    2055                         $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_status = 'inherit' AND ID != %d AND post_parent = %d LIMIT 1", $post_ID, $post_parent)); 
     2055                        $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_status = 'inherit' AND ID != %d AND post_parent = %d LIMIT 1", $alt_post_name, $post_ID, $post_parent)); 
    20562056                        $suffix++; 
    20572057                } 
    20582058                $post_name = $alt_post_name; 
     
    21182118 
    21192119        if ( $file ) 
    21202120                update_attached_file( $post_ID, $file ); 
    2121                  
     2121 
    21222122        clean_post_cache($post_ID); 
    21232123 
    21242124        if ( $update) { 
     
    23152315                return false; 
    23162316        if ( !$url = wp_get_attachment_url( $post->ID ) ) 
    23172317                return false; 
    2318                  
     2318 
    23192319        $sized = image_downsize( $post_id, 'thumbnail' ); 
    23202320        if ( $sized ) 
    23212321                return $sized[0];