Make WordPress Core


Ignore:
Timestamp:
12/15/2009 05:53:51 PM (15 years ago)
Author:
ryan
Message:

Fix upload dir defaults. Props Denis-de-Bernardy. fixes #11276

File:
1 edited

Legend:

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

    r12403 r12405  
    20362036    $upload_path = get_option( 'upload_path' );
    20372037    $upload_path = trim($upload_path);
    2038     if ( empty($upload_path) )
     2038    if ( empty($upload_path) ) {
    20392039        $dir = WP_CONTENT_DIR . '/uploads';
    2040     else
     2040    } else {
    20412041        $dir = $upload_path;
    2042 
    2043     // $dir is absolute, $path is (maybe) relative to ABSPATH
    2044     $dir = path_join( ABSPATH, $dir );
     2042        if ( 'wp-content/uploads' == $upload_path ) {
     2043            $dir = WP_CONTENT_DIR . '/uploads';
     2044        } elseif ( 0 !== strpos($dir, ABSPATH) ) {
     2045            // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
     2046            $dir = path_join( ABSPATH, $dir );
     2047        }
     2048    }
    20452049
    20462050    if ( !$url = get_option( 'upload_url_path' ) ) {
    2047         if ( empty($upload_path) or ( $upload_path == $dir ) )
     2051        if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) )
    20482052            $url = WP_CONTENT_URL . '/uploads';
    20492053        else
Note: See TracChangeset for help on using the changeset viewer.