Ticket #33756: 33756.diff
| File 33756.diff, 1.4 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/formatting.php
1440 1440 } 1441 1441 1442 1442 /** 1443 * Sanitizes a title, or returns a fallback title.1443 * Sanitizes a string for use as a slug in a URL. 1444 1444 * 1445 1445 * Specifically, HTML and PHP tags are stripped. Further actions can be added 1446 * via the plugin API. If $title is empty and $fallback_title is set, the latter 1447 * will be used. 1446 * via the plugin API. 1448 1447 * 1448 * If the sanitized version of $title is empty, $fallback_title will be returned. 1449 * 1449 1450 * @since 1.0.0 1450 1451 * 1451 1452 * @param string $title The string to be sanitized. … … 1491 1492 } 1492 1493 1493 1494 /** 1494 * Sanitizes a title, replacing whitespace and a few other characters with dashes. 1495 * Sanitizes a string. Output is limited to to alphanumeric characters, 1496 * underscore (_) and dash (-). 1495 1497 * 1496 * Limits the output to alphanumeric characters, underscore (_) and dash (-). 1497 * Whitespace becomes a dash. 1498 * Various characters (including whitespace) are convered to dashes. 1498 1499 * 1499 1500 * @since 1.2.0 1500 1501 * … … 1520 1521 } 1521 1522 1522 1523 $title = strtolower($title); 1523 $title = preg_replace('/&.+?;/', '', $title); // kill entities 1524 // Remove HTML entities. 1525 $title = preg_replace('/&.+?;/', '', $title); 1524 1526 $title = str_replace('.', '-', $title); 1525 1527 1526 1528 if ( 'save' == $context ) {