Ticket #19292: 19292.3.diff
| File 19292.3.diff, 2.7 KB (added by nacin, 18 months ago) |
|---|
-
wp-includes/post.php
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 the old, fixed sanitization context. 2494 $check_name = sanitize_title( $post_name, '', 'old-save' ); 2495 if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $ID ) == $check_name ) 2496 $post_name = $check_name; 2497 else // new post, or slug has changed. 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 … … 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; -
wp-includes/query.php
1838 1838 } 1839 1839 1840 1840 if ( !empty($q['tag_slug__in']) ) { 1841 $q['tag_slug__in'] = array_map('sanitize_title ', array_unique( (array) $q['tag_slug__in'] ) );1841 $q['tag_slug__in'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__in'] ) ); 1842 1842 $tax_query[] = array( 1843 1843 'taxonomy' => 'post_tag', 1844 1844 'terms' => $q['tag_slug__in'], … … 1847 1847 } 1848 1848 1849 1849 if ( !empty($q['tag_slug__and']) ) { 1850 $q['tag_slug__and'] = array_map('sanitize_title ', array_unique( (array) $q['tag_slug__and'] ) );1850 $q['tag_slug__and'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__and'] ) ); 1851 1851 $tax_query[] = array( 1852 1852 'taxonomy' => 'post_tag', 1853 1853 'terms' => $q['tag_slug__and'], -
wp-admin/js/post.dev.js
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,
