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:
Matt Mullenweg 2004-01-14 05:46:53 +00:00
parent 07604037d0
commit 8ac0a3a2ca
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}