Ticket #3843: unicode-punctuation-removal.diff
| File unicode-punctuation-removal.diff, 1.6 kB (added by noel, 3 months ago) |
|---|
-
wp-includes/formatting.php
old new 367 367 return $title; 368 368 } 369 369 370 function sanitize_title_permalink($title) { 371 372 #remove unicode characters that are in the wrong unicode category 373 $title = sanitize_title_with_dashes(preg_replace( '/[\p{P}\p{So}\p{M}\p{No}\p{Nl}]/u', '-', $title) ); 374 375 return $title; 376 } 377 370 378 // ensures a string is a valid SQL order by clause like: post_name ASC, ID DESC 371 379 // accepts one or more columns, with or without ASC/DESC, and also accepts RAND() 372 380 function sanitize_sql_orderby( $orderby ){ -
wp-admin/includes/post.php
old new 574 574 if (in_array($post->post_status, array('draft', 'pending'))) { 575 575 $post->post_status = 'publish'; 576 576 $post->post_date = date('Y-m-d H:i:s'); 577 $post->post_name = sanitize_title ($post->post_name? $post->post_name : $post->post_title, $post->ID);577 $post->post_name = sanitize_title_permalink($post->post_name? $post->post_name : $post->post_title, $post->ID); 578 578 } 579 579 580 580 // If the user wants to set a new name -- override the current one 581 581 // Note: if empty name is supplied -- use the title instead, see #6072 582 582 if (!is_null($name)) { 583 $post->post_name = sanitize_title ($name? $name : $title, $post->ID);583 $post->post_name = sanitize_title_permalink($name? $name : $title, $post->ID); 584 584 } 585 585 586 586 $permalink = get_permalink($post, true);
