WordPress.org

Make WordPress Core

Changeset 5020


Ignore:
Timestamp:
03/10/2007 06:25:33 AM (14 years ago)
Author:
markjaquith
Message:

new function: untrailingslashit(). fixes #3899

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r4990 r5020  
    564564
    565565function trailingslashit($string) {
    566         if ( '/' != substr($string, -1)) {
     566        if ( '/' != substr($string, -1))
    567567                $string .= '/';
    568         }
    569568        return $string;
     569}
     570
     571function untrailingslashit($string) {
     572    return preg_replace('|/+$|', '', $string);
    570573}
    571574
  • trunk/wp-includes/link-template.php

    r5019 r5020  
    2525        $string = trailingslashit($string);
    2626    else
    27         $string = preg_replace('|/+$|', '', $string); // untrailing slash
     27        $string = untrailingslashit($string);
    2828
    2929    // Note that $type_of_url can be one of following:
Note: See TracChangeset for help on using the changeset viewer.