WordPress.org

Make WordPress Core

Changeset 5685


Ignore:
Timestamp:
06/12/07 20:49:40 (8 years ago)
Author:
markjaquith
Message:

Make sure post titles longer than 200 chars get unique slugs. fixes #4433. props AaronCampbell.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r5616 r5685  
    607607            $suffix = 2; 
    608608            do { 
    609                 $alt_post_name = $post_name . "-$suffix"; 
     609                $alt_post_name = substr($post_name, 0, 200-(strlen($suffix)+1)). "-$suffix"; 
    610610                $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"); 
    611611                $suffix++; 
Note: See TracChangeset for help on using the changeset viewer.