Make WordPress Core


Ignore:
Timestamp:
01/14/2006 10:09:51 PM (20 years ago)
Author:
ryan
Message:

More upload path tweaks. fixes #2271

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-post.php

    r3433 r3437  
    879879    $siteurl = get_settings('siteurl');
    880880    //prepend ABSPATH to $dir and $siteurl to $url if they're not already there
    881     $dir = ABSPATH . str_replace(ABSPATH, '', trim(get_settings('fileupload_realpath')));
    882     $url = $siteurl . str_replace($siteurl, '', trim(get_settings('fileupload_url')));
     881    $path = str_replace(ABSPATH, '', trim(get_settings('upload_path')));
     882    $dir = ABSPATH . $path;
     883    $url = trailingslashit($siteurl) . $path;
    883884
    884885    if ( $dir == ABSPATH ) { //the option was empty
    885886        $dir = ABSPATH . 'wp-content/uploads';
    886887    }
    887     if ( $url == $siteurl ) { //the option was empty
    888         $url = get_option('siteurl') . '/' . str_replace(ABSPATH, '', $dir);
    889     }
    890888
    891889    if ( defined('UPLOADS') ) {
    892890        $dir = ABSPATH . UPLOADS;
    893         $url =  get_option('siteurl') . '/' . UPLOADS;
    894     }
    895 
    896     if ( get_settings('uploads_yearmonth_folders')) {
     891        $url = trailingslashit($siteurl) . UPLOADS;
     892    }
     893
     894    if ( get_settings('uploads_use_yearmonth_folders')) {
    897895        // Generate the yearly and monthly dirs
    898896        $time = current_time( 'mysql' );
Note: See TracChangeset for help on using the changeset viewer.