Make WordPress Core


Ignore:
Timestamp:
03/10/2007 08:32:57 AM (18 years ago)
Author:
markjaquith
Message:

Improvements to untrailingslashit() and trailingslashit(). props Jamie Talbot. fixes #3899

File:
1 edited

Legend:

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

    r5020 r5021  
    564564
    565565function trailingslashit($string) {
    566         if ( '/' != substr($string, -1))
    567                 $string .= '/';
    568         return $string;
     566    return untrailingslashit($string) . '/';
    569567}
    570568
    571569function untrailingslashit($string) {
    572     return preg_replace('|/+$|', '', $string);
     570    return rtrim($string, '/');
    573571}
    574572
Note: See TracChangeset for help on using the changeset viewer.