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

git-svn-id: https://develop.svn.wordpress.org/trunk@18637 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2011-09-05 16:53:19 +00:00
parent a967718ed3
commit 78b5130751
2 changed files with 5 additions and 9 deletions
+3 -6
View File
@@ -1521,8 +1521,7 @@ function get_dirsize( $directory ) {
function recurse_dirsize( $directory ) {
$size = 0;
if ( substr( $directory, -1 ) == '/' )
$directory = substr($directory,0,-1);
$directory = untrailingslashit( $directory );
if ( !file_exists($directory) || !is_dir( $directory ) || !is_readable( $directory ) )
return false;
@@ -1565,8 +1564,7 @@ function upload_is_user_over_quota( $echo = true ) {
if ( empty( $spaceAllowed ) || !is_numeric( $spaceAllowed ) )
$spaceAllowed = 10; // Default space allowed is 10 MB
$dirName = BLOGUPLOADDIR;
$size = get_dirsize($dirName) / 1024 / 1024;
$size = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;
if ( ($spaceAllowed-$size) < 0 ) {
if ( $echo )
@@ -1647,8 +1645,7 @@ function fix_import_form_size( $size ) {
return 0;
$spaceAllowed = 1024 * 1024 * get_space_allowed();
$dirName = BLOGUPLOADDIR;
$dirsize = get_dirsize($dirName) ;
$dirsize = get_dirsize( BLOGUPLOADDIR );
if ( $size > $spaceAllowed - $dirsize )
return $spaceAllowed - $dirsize; // remaining space
else