Ticket #19292: 19292.2.diff
File 19292.2.diff, 2.0 KB (added by , 12 years ago) |
---|
-
wp-admin/js/post.dev.js
jQuery(document).ready( function($) { 547 547 b.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+'</a>'); 548 548 b.children('.save').click(function() { 549 549 var new_slug = e.children('input').val(); 550 if ( new_slug == $('#editable-post-name-full').text() ) { 551 return $('.cancel', '#edit-slug-buttons').click(); 552 } 550 553 $.post(ajaxurl, { 551 554 action: 'sample-permalink', 552 555 post_id: post_id, -
wp-includes/post.php
function wp_insert_post($postarr, $wp_error = false) { 2490 2490 else 2491 2491 $post_name = ''; 2492 2492 } else { 2493 $post_name = sanitize_title($post_name); 2493 // On updates, we need to check to see if it's using an old sanitization context, or the newer Save context 2494 $check_name = sanitize_title( $post_name, '', 'query'); // sanitize_title_for_query(), but spelt out here for readability 2495 if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $ID ) == $check_name ) 2496 $post_name = $check_name; 2497 else // slug has changed or uses newer (default) sanitization 2498 $post_name = sanitize_title($post_name); 2494 2499 } 2495 2500 2496 2501 // If the post date is empty (due to having been new or a draft) and status is not 'draft' or 'pending', set date to now … … function get_page_by_path($page_path, $output = OBJECT, $post_type = 'page') { 3153 3158 $page_path = str_replace('%20', ' ', $page_path); 3154 3159 $parts = explode( '/', trim( $page_path, '/' ) ); 3155 3160 $parts = array_map( 'esc_sql', $parts ); 3156 $parts = array_map( 'sanitize_title ', $parts );3161 $parts = array_map( 'sanitize_title_for_query', $parts ); 3157 3162 3158 3163 $in_string = "'". implode( "','", $parts ) . "'"; 3159 3164 $post_type_sql = $post_type;