WordPress.org

Make WordPress Core

Ticket #4433: post.diff

File post.diff, 628 bytes (added by AaronCampbell, 12 years ago)

Diff for wp-includes/post.php to fix bug

  • .php

    old new  
    600600                if ($post_name_check || in_array($post_name, $wp_rewrite->feeds) ) {
    601601                        $suffix = 2;
    602602                        do {
    603                                 $alt_post_name = $post_name . "-$suffix";
     603                                $alt_post_name = substr($post_name, 0, 200-(strlen($suffix)+1)). "-$suffix";
    604604                                $post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1");
    605605                                $suffix++;
    606606                        } while ($post_name_check);