From 5fd2feb54c38fc6f357026aadd8abfd224631c26 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 22 Feb 2007 14:24:41 +0000 Subject: WP Merge to 4914 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@896 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wp-includes/functions.php') diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 0a43602..aaaefc1 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1113,7 +1113,7 @@ function wp_upload_dir() { return apply_filters('upload_dir', $uploads); } -function wp_upload_bits($name, $type, $bits) { +function wp_upload_bits($name, $type, $bits, $overwrite = false) { if ( empty($name) ) return array('error' => __("Empty filename")); @@ -1134,7 +1134,7 @@ function wp_upload_bits($name, $type, $bits) { $ext = ''; else $ext = ".$ext"; - while ( file_exists($upload['path'] . "/$filename") ) { + while ( file_exists($upload['path'] . "/$filename") && !$overwrite ) { if ( '' == "$number$ext" ) $filename = $filename . ++$number . $ext; else -- cgit