WordPress.org

Make WordPress Core

Ticket #5539: post.diff

File post.diff, 1.8 KB (added by xknown, 12 years ago)

\s is not a valid escape sequence

  • wp-includes/post.php

     
    748748        $parent_where = array( 'post_parent' => $postid );
    749749
    750750        if ( 'page' == $post->post_type) {
    751                 // if the page is defined in option page_on_front or post_for_posts, 
     751                // if the page is defined in option page_on_front or post_for_posts,
    752752                // adjust the corresponding options
    753753                if ( get_option('page_on_front') == $postid ) {
    754754                        update_option('show_on_front', 'posts');
     
    760760
    761761                // Point children of this page to its parent, also clean the cache of affected children
    762762                $children_query = $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type='page'", $postid);
    763                 $children = $wpdb->get_results($children_query); 
     763                $children = $wpdb->get_results($children_query);
    764764
    765765                $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'page' ) );
    766766        }
     
    777777        if ( 'page' == $post->post_type ) {
    778778                clean_page_cache($postid);
    779779
    780                 foreach ( (array) $children as $child ) 
     780                foreach ( (array) $children as $child )
    781781                        clean_page_cache($child->ID);
    782782
    783783                $wp_rewrite->flush_rules();
     
    10491049                $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update
    10501050                $wpdb->insert( $wpdb->posts, $data );
    10511051                $post_ID = (int) $wpdb->insert_id;
    1052                
     1052
    10531053                // use the newly generated $post_ID
    10541054                $where = array( 'ID' => $post_ID );
    10551055        }
     
    11931193
    11941194        if ( empty($tags) )
    11951195                $tags = array();
    1196         $tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \s\n\t\r\0\x0B,") );
     1196        $tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \n\t\r\0\x0B,") );
    11971197        wp_set_object_terms($post_id, $tags, 'post_tag', $append);
    11981198}
    11991199