Index: functions.php
===================================================================
--- functions.php	(revision 19735)
+++ functions.php	(working copy)
@@ -1505,7 +1505,7 @@
  */
 function wp_upload_dir( $time = null ) {
 	global $switched;
-	$siteurl = get_option( 'siteurl' );
+	$siteurl = site_url();
 	$upload_path = get_option( 'upload_path' );
 	$upload_path = trim($upload_path);
 	$main_override = is_multisite() && defined( 'MULTISITE' ) && is_main_site();
