Changeset 27344 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 03/01/2014 09:44:43 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r27284 r27344 1483 1483 * Appends a trailing slash. 1484 1484 * 1485 * Will remove trailing slash if it exists already before adding a trailing1486 * slash. This prevents double slashing a string or path.1485 * Will remove trailing forward and backslashes if it exists already before adding 1486 * a trailing forward slash. This prevents double slashing a string or path. 1487 1487 * 1488 1488 * The primary use of this is for paths and thus should be used for paths. It is … … 1490 1490 * 1491 1491 * @since 1.2.0 1492 * @uses untrailingslashit() Unslashes string if it was slashed already.1493 1492 * 1494 1493 * @param string $string What to add the trailing slash to. 1495 1494 * @return string String with trailing slash added. 1496 1495 */ 1497 function trailingslashit( $string) {1498 return untrailingslashit( $string) . '/';1499 } 1500 1501 /** 1502 * Removes trailing slash if it exists.1496 function trailingslashit( $string ) { 1497 return untrailingslashit( $string ) . '/'; 1498 } 1499 1500 /** 1501 * Removes trailing forward slashes and backslashes if they exist. 1503 1502 * 1504 1503 * The primary use of this is for paths and thus should be used for paths. It is … … 1507 1506 * @since 2.2.0 1508 1507 * 1509 * @param string $string What to remove the trailing slash from.1510 * @return string String without the trailing slash .1511 */ 1512 function untrailingslashit( $string) {1513 return rtrim( $string, '/');1508 * @param string $string What to remove the trailing slashes from. 1509 * @return string String without the trailing slashes. 1510 */ 1511 function untrailingslashit( $string ) { 1512 return rtrim( $string, '/\\' ); 1514 1513 } 1515 1514
Note: See TracChangeset
for help on using the changeset viewer.