Make entity catch in sanitize_title ungreedy.

git-svn-id: http://svn.automattic.com/wordpress/trunk@775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-01-14 05:46:53 +00:00
parent 5c4302e582
commit c38e0e27b8
1 changed files with 2 additions and 2 deletions

View File

@ -88,12 +88,12 @@ function wpautop($pee, $br = 1) {
function sanitize_title($title) { function sanitize_title($title) {
$title = strtolower($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('/[^a-z0-9 -]/', '', $title);
$title = preg_replace('/\s+/', ' ', $title); $title = preg_replace('/\s+/', ' ', $title);
$title = trim($title); $title = trim($title);
$title = str_replace(' ', '-', $title); $title = str_replace(' ', '-', $title);
$title = preg_replace('|[-]+|', '-', $title); $title = preg_replace('|-+|', '-', $title);
return $title; return $title;
} }