Make WordPress Core

Ticket #45725: enhance_uploads_directory_path.diff

File enhance_uploads_directory_path.diff, 810 bytes (added by Fleuv, 7 years ago)
  • functions.php

     
    636636                        . '(?:'
    637637                                . '\([\w\d]+\)|'
    638638                                . '(?:'
    639                                         . "[^`!()\[\]{};:'\".,<>«»“”‘’\s]|"
     639                                        . "[^`!()\[\]{};:'\".,<>«»“”‘’\s]|"
    640640                                        . '(?:[:]\d+)?/?'
    641641                                . ')+'
    642642                        . ')'
     
    21342134         * We also sometimes obey UPLOADS when rewriting is enabled -- see the next block.
    21352135         */
    21362136        if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) {
    2137                 $dir = ABSPATH . UPLOADS;
     2137                $dir = defined( 'UPLOADS_DIR' ) ? UPLOADS_DIR : ( defined( 'INDEX_ABSPATH' ) ? SITE_ABSPATH : ABSPATH ) . UPLOADS ;
    21382138                $url = trailingslashit( $siteurl ) . UPLOADS;
    21392139        }
    21402140