summaryrefslogtreecommitdiffstats
path: root/wp-includes/functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-01-24 18:51:01 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-01-24 18:51:01 +0000
commitc91fd8d98e0fd5260282a2cfced97d743067076e (patch)
tree8381b5ce5fab956c40e694ce6c4a136aa3c4ea54 /wp-includes/functions.php
parent7def74bb3f619759851d10c371fea6e04c95a670 (diff)
downloadwordpress-mu-c91fd8d98e0fd5260282a2cfced97d743067076e.tar.gz
wordpress-mu-c91fd8d98e0fd5260282a2cfced97d743067076e.tar.xz
wordpress-mu-c91fd8d98e0fd5260282a2cfced97d743067076e.zip
Added "wp_upload_bits" filter to check uploaded files before writing them
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1191 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/functions.php')
-rw-r--r--wp-includes/functions.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index a067a8a..ac36fd4 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1021,6 +1021,13 @@ function wp_upload_bits($name, $type, $bits) {
if ( $upload['error'] !== false )
return $upload;
+ /* WPMU check file before writing it */
+ $upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' => $name, 'bits' => $bits, 'time' => $time ) );
+ if( is_array( $upload_bits_error ) == false ) {
+ $upload[ 'error' ] = $upload_bits_error;
+ return $upload;
+ }
+
$number = '';
$filename = $name;
$path_parts = pathinfo($filename);