WordPress.org

Make WordPress Core

Changeset 7134


Ignore:
Timestamp:
03/03/08 04:14:16 (7 years ago)
Author:
matt
Message:

Deal correctly with empty upload_path option. Hat tip: tellyworth.

File:
1 edited

Legend:

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

    r7130 r7134  
    10641064function wp_upload_dir( $time = NULL ) { 
    10651065    $siteurl = get_option( 'siteurl' ); 
    1066     $upload_path = $dir = get_option( 'upload_path' ); 
     1066    $upload_path = get_option( 'upload_path' ); 
     1067    if ( trim($upload_path) === '' ) 
     1068        $upload_path = 'wp-content/uploads'; 
     1069    $dir = $upload_path; 
    10671070 
    10681071    // $dir is absolute, $path is (maybe) relative to ABSPATH 
     
    10721075    if ( !$url = get_option( 'upload_url_path' ) ) 
    10731076        $url = trailingslashit( $siteurl ) . $path; 
    1074  
    1075     if ( $dir == ABSPATH ) // the option was empty 
    1076         $dir = ABSPATH . 'wp-content/uploads'; 
    10771077 
    10781078    if ( defined('UPLOADS') ) { 
Note: See TracChangeset for help on using the changeset viewer.