[wp-trac] [WordPress Trac] #12639: upload_url_path is always overwritten in function wp_upload_dir

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 18 19:31:22 UTC 2010


#12639: upload_url_path is always overwritten in function wp_upload_dir
--------------------------+-------------------------------------------------
 Reporter:  jimmcq        |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  3.0
Component:  Upload        |     Version:  3.0
 Severity:  major         |    Keywords:     
--------------------------+-------------------------------------------------
 I need to have a custom upload_path and upload_url_path so that uploads
 are served from a separate dedicated server.  The problem is that the file
 URL is always being overwritten by a URL that points to a subdirectory
 under my main wordpress install.

 I tracked down the problem to the following code within the  wp_upload_dir
 function of wp-includes/functions.php:


 {{{
 if ( defined('UPLOADS') && ( WP_CONTENT_DIR . '/uploads' != ABSPATH .
 $upload_path ) ) {
     $dir = ABSPATH . UPLOADS;
     $url = trailingslashit( $siteurl ) . UPLOADS;
 }
 }}}

 Because I have an $upload_path defined this conditional is always trigged
 and the $url is overwitten when I want it to keep it as get_option(
 'upload_url_path' )

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12639>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list