summaryrefslogtreecommitdiffstats
path: root/wp-content
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-24 13:09:18 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-24 13:09:18 +0000
commit42bccb6b1a72035b82e37c42e8982e4b514348a9 (patch)
treef4831c21b3c566a5da8f97dd4d0c4a62286d5c1c /wp-content
parent1b41810d3e6c41119725ea46dfd8374e2c1bcc42 (diff)
downloadwordpress-mu-42bccb6b1a72035b82e37c42e8982e4b514348a9.tar.gz
wordpress-mu-42bccb6b1a72035b82e37c42e8982e4b514348a9.tar.xz
wordpress-mu-42bccb6b1a72035b82e37c42e8982e4b514348a9.zip
Fix import menu file size, fixes #324
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@989 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-content')
-rw-r--r--wp-content/mu-plugins/misc.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/wp-content/mu-plugins/misc.php b/wp-content/mu-plugins/misc.php
index 46a8618..a0d2e09 100644
--- a/wp-content/mu-plugins/misc.php
+++ b/wp-content/mu-plugins/misc.php
@@ -132,4 +132,17 @@ 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 )
+ return 0;
+ $dirName = constant( "ABSPATH" ) . constant( "UPLOADS" );
+ $dirsize = get_dirsize($dirName) / 1024;
+ if( $size > $dirsize ) {
+ return $dirsize;
+ } else {
+ return $size;
+ }
+}
+add_filter( 'import_upload_size_limit', 'fix_import_form_size' );
+
?>