Correct an SQL syntax error introduced in r30158. Adds tests.

Fixes #30339
See #18962
Props julien731

Built from https://develop.svn.wordpress.org/trunk@30480


git-svn-id: http://core.svn.wordpress.org/trunk@30468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-11-20 16:46:22 +00:00
parent a69a12aab1
commit b50cbe1f4f
2 changed files with 2 additions and 2 deletions

View File

@ -3720,7 +3720,7 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
$suffix = 2; $suffix = 2;
do { do {
$alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID, $post_parent ) ); $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID, $post_parent ) );
$suffix++; $suffix++;
} while ( $post_name_check ); } while ( $post_name_check );
$slug = $alt_post_name; $slug = $alt_post_name;

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.1-beta1-30479'; $wp_version = '4.1-beta1-30480';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.