diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index ce75e1774f..ee9c959392 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -907,7 +907,7 @@ function wp_upload_bits($name, $type, $bits) { while ( file_exists($upload['path'] . "/$filename") ) $filename = str_replace("$number.$ext", ++$number . ".$ext", $filename); - $new_file = $uploads['path'] . "/$filename"; + $new_file = $upload['path'] . "/$filename"; $ifp = @ fopen($new_file, 'wb'); if ( ! $ifp ) return array('error' => "Could not write file $new_file.");