Ticket #6934: 6934.diff
| File 6934.diff, 1.8 kB (added by xknown, 7 months ago) |
|---|
-
wp-includes/post.php
old new 1260 1260 if ( $wp_error ) 1261 1261 return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error); 1262 1262 else 1263 return 0; 1263 return 0; 1264 1264 } 1265 1265 $post_ID = (int) $wpdb->insert_id; 1266 1266 … … 1924 1924 $where = "$exclusions $inclusions "; 1925 1925 if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) { 1926 1926 $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 1929 1929 $meta_key = stripslashes($meta_key); 1930 1930 $meta_value = stripslashes($meta_value); 1931 1931 if ( ! empty( $meta_key ) ) … … 2052 2052 while ($post_name_check) { 2053 2053 $alt_post_name = $post_name . "-$suffix"; 2054 2054 // 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)); 2056 2056 $suffix++; 2057 2057 } 2058 2058 $post_name = $alt_post_name; … … 2118 2118 2119 2119 if ( $file ) 2120 2120 update_attached_file( $post_ID, $file ); 2121 2121 2122 2122 clean_post_cache($post_ID); 2123 2123 2124 2124 if ( $update) { … … 2315 2315 return false; 2316 2316 if ( !$url = wp_get_attachment_url( $post->ID ) ) 2317 2317 return false; 2318 2318 2319 2319 $sized = image_downsize( $post_id, 'thumbnail' ); 2320 2320 if ( $sized ) 2321 2321 return $sized[0];
