From 8ac0a3a2ca738879be0df3b447a7b3957e17656e Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Wed, 14 Jan 2004 05:46:53 +0000 Subject: [PATCH] Make entity catch in sanitize_title ungreedy. git-svn-id: https://develop.svn.wordpress.org/trunk@775 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c8f4b10ccf..3b77d7dd0a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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; }