WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/14/2004 05:46:53 AM (17 years ago)
Author:
saxmatt
Message:

Make entity catch in sanitize_title ungreedy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r774 r775  
    8989function sanitize_title($title) {
    9090    $title = strtolower($title);
    91     $title = preg_replace('/&.+;/', '', $title); // kill entities
     91    $title = preg_replace('/&.+?;/', '', $title); // kill entities
    9292    $title = preg_replace('/[^a-z0-9 -]/', '', $title);
    9393    $title = preg_replace('/\s+/', ' ', $title);
    9494    $title = trim($title);
    9595    $title = str_replace(' ', '-', $title);
    96     $title = preg_replace('|[-]+|', '-', $title);
     96    $title = preg_replace('|-+|', '-', $title);
    9797    return $title;
    9898}
Note: See TracChangeset for help on using the changeset viewer.