Ticket #21767: 21767.20.diff
File 21767.20.diff, 2.5 KB (added by , 11 years ago) |
---|
-
wp-includes/post.php
2618 2618 * 'guid' - Global Unique ID for referencing the attachment. 2619 2619 * 'post_content_filtered' - Post content filtered. 2620 2620 * 'post_excerpt' - Post excerpt. 2621 * 'slashed' - Whether the passed data is slashed or not. The default is true. 2621 2622 * 2622 2623 * @since 1.0.0 2623 2624 * @uses $wpdb … … 2639 2640 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 2640 2641 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 2641 2642 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 2642 'post_content' => '', 'post_title' => '' );2643 'post_content' => '', 'post_title' => '', 'slashed' => true ); 2643 2644 2644 2645 $postarr = wp_parse_args($postarr, $defaults); 2645 2646 2646 2647 unset( $postarr[ 'filter' ] ); 2647 2648 2649 if ( ! $postarr['slashed'] ) 2650 $postarr = wp_slash( $postarr ); 2651 2648 2652 $postarr = sanitize_post($postarr, 'db'); 2649 2653 2650 2654 // export array as variables … … 2905 2909 // non-escaped post was passed 2906 2910 $postarr = get_object_vars($postarr); 2907 2911 $postarr = wp_slash($postarr); 2912 $postarr['slashed'] = true; 2913 } else { 2914 if ( ! isset( $postarr['slashed'] ) ) 2915 $postarr['slashed'] = true; 2916 2917 if ( ! $postarr['slashed'] ) 2918 $postarr = wp_slash( $postarr ); 2908 2919 } 2909 2920 2910 2921 // First, get all of the original fields … … 3858 3869 * 'guid' - Global Unique ID for referencing the attachment. 3859 3870 * 'post_content_filtered' - Attachment post content filtered. 3860 3871 * 'post_excerpt' - Attachment excerpt. 3872 * 'slashed' - Whether the passed data is slashed or not. The default is true. 3861 3873 * 3862 3874 * @since 2.0.0 3863 3875 * @uses $wpdb … … 3876 3888 $defaults = array('post_status' => 'inherit', 'post_type' => 'post', 'post_author' => $user_ID, 3877 3889 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 3878 3890 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 3879 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => ''); 3891 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => '', 3892 'slashed' => true ); 3880 3893 3881 3894 $object = wp_parse_args($object, $defaults); 3882 3895 if ( !empty($parent) ) … … 3884 3897 3885 3898 unset( $object[ 'filter' ] ); 3886 3899 3900 if ( ! $object['slashed'] ) 3901 $object = wp_slash( $object ); 3902 3887 3903 $object = sanitize_post($object, 'db'); 3888 3904 3889 3905 // export array as variables