Make WordPress Core

Changeset 18637


Ignore:
Timestamp:
09/05/2011 04:53:19 PM (13 years ago)
Author:
nacin
Message:

Use untrailingslashit in url_shorten() and recurse_dirsize(). Remove unnecessary camelCase variables. see #18592.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r18349 r18637  
    224224    $short_url = str_replace( 'http://', '', stripslashes( $url ));
    225225    $short_url = str_replace( 'www.', '', $short_url );
    226     if ('/' == substr( $short_url, -1 ))
    227         $short_url = substr( $short_url, 0, -1 );
     226    $short_url = untrailingslashit( $short_url );
    228227    if ( strlen( $short_url ) > 35 )
    229         $short_url = substr( $short_url, 0, 32 ).'...';
     228        $short_url = substr( $short_url, 0, 32 ) . '...';
    230229    return $short_url;
    231230}
  • trunk/wp-includes/ms-functions.php

    r18560 r18637  
    15221522    $size = 0;
    15231523
    1524     if ( substr( $directory, -1 ) == '/' )
    1525         $directory = substr($directory,0,-1);
     1524    $directory = untrailingslashit( $directory );
    15261525
    15271526    if ( !file_exists($directory) || !is_dir( $directory ) || !is_readable( $directory ) )
     
    15661565        $spaceAllowed = 10; // Default space allowed is 10 MB
    15671566
    1568     $dirName = BLOGUPLOADDIR;
    1569     $size = get_dirsize($dirName) / 1024 / 1024;
     1567    $size = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;
    15701568
    15711569    if ( ($spaceAllowed-$size) < 0 ) {
     
    16481646
    16491647    $spaceAllowed = 1024 * 1024 * get_space_allowed();
    1650     $dirName = BLOGUPLOADDIR;
    1651     $dirsize = get_dirsize($dirName) ;
     1648    $dirsize = get_dirsize( BLOGUPLOADDIR );
    16521649    if ( $size > $spaceAllowed - $dirsize )
    16531650        return $spaceAllowed - $dirsize; // remaining space
Note: See TracChangeset for help on using the changeset viewer.