diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 8aa3b3dcd0..3db3b512ed 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -41,12 +41,14 @@ function tag_flush_to_text(e,a) { a = a || false; var text = a ? jQuery(a).text() : jQuery('#newtag').val(); var newtags = jQuery('#tags-input').val(); - var t = text.replace( /\s*([^,]+)[\s,]*/, '$1' ); + + var t = text.replace( /\s*([^,]+).*/, '$1,' ); + newtags += ',' if ( newtags.indexOf(t) != -1 ) return false; - newtags += ',' + text; + newtags += text; // massage newtags = newtags.replace( /\s+,+\s*/g, ',' ).replace( /,+/g, ',' ).replace( /,+\s+,+/g, ',' ).replace( /,+\s*$/g, '' ).replace( /^\s*,+/g, '' ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 4277eb95fe..0ad90ed9a1 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -176,7 +176,7 @@ function wp_default_scripts( &$scripts ) { 'save' => __('Save'), 'cancel' => __('Cancel'), ) ); - $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '20081103' ); + $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '20081105' ); $scripts->localize( 'post', 'postL10n', array( 'tagsUsed' => __('Tags used on this post:'), 'add' => attribute_escape(__('Add')),