summaryrefslogtreecommitdiffstats
path: root/wp-includes/wpmu-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-04-08 17:50:18 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-04-08 17:50:18 +0000
commit02907810007f81acc061148c98049c493c734e2e (patch)
tree44492eca62c3cc4cdbb2649246e0cc6c5079de7b /wp-includes/wpmu-functions.php
parent6fa96b69841ed7d437dbcc178b53e695f29ec007 (diff)
downloadwordpress-mu-02907810007f81acc061148c98049c493c734e2e.tar.gz
wordpress-mu-02907810007f81acc061148c98049c493c734e2e.tar.xz
wordpress-mu-02907810007f81acc061148c98049c493c734e2e.zip
Fix import upload size, fixes #571
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1222 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/wpmu-functions.php')
-rw-r--r--wp-includes/wpmu-functions.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index 9043bad..c184d36 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -1623,14 +1623,15 @@ function scriptaculous_admin_loader() {
add_action( 'admin_print_scripts', 'scriptaculous_admin_loader' );
function fix_import_form_size( $size ) {
- if( upload_is_user_over_quota( false ) == false )
+ if( upload_is_user_over_quota( false ) == true )
return 0;
+ $spaceAllowed = 1024 * 1024 * get_space_allowed();
$dirName = constant( "ABSPATH" ) . constant( "UPLOADS" );
- $dirsize = get_dirsize($dirName) / 1024;
- if( $size > $dirsize ) {
- return $dirsize;
+ $dirsize = get_dirsize($dirName) ;
+ if( $size > $spaceAllowed - $dirsize ) {
+ return $spaceAllowed - $dirsize; // remaining space
} else {
- return $size;
+ return $size; // default
}
}
add_filter( 'import_upload_size_limit', 'fix_import_form_size' );