mirror of
git://develop.git.wordpress.org/
synced 2025-01-19 13:47:02 +01:00
Make entity catch in sanitize_title ungreedy.
git-svn-id: https://develop.svn.wordpress.org/trunk@775 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
07604037d0
commit
8ac0a3a2ca
@ -88,12 +88,12 @@ function wpautop($pee, $br = 1) {
|
||||
|
||||
function sanitize_title($title) {
|
||||
$title = strtolower($title);
|
||||
$title = preg_replace('/&.+;/', '', $title); // kill entities
|
||||
$title = preg_replace('/&.+?;/', '', $title); // kill entities
|
||||
$title = preg_replace('/[^a-z0-9 -]/', '', $title);
|
||||
$title = preg_replace('/\s+/', ' ', $title);
|
||||
$title = trim($title);
|
||||
$title = str_replace(' ', '-', $title);
|
||||
$title = preg_replace('|[-]+|', '-', $title);
|
||||
$title = preg_replace('|-+|', '-', $title);
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user