mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
More upload path tweaks. fixes #2271
git-svn-id: https://develop.svn.wordpress.org/trunk@3437 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -878,22 +878,20 @@ function wp_mkdir_p($target) {
|
||||
function wp_upload_dir() {
|
||||
$siteurl = get_settings('siteurl');
|
||||
//prepend ABSPATH to $dir and $siteurl to $url if they're not already there
|
||||
$dir = ABSPATH . str_replace(ABSPATH, '', trim(get_settings('fileupload_realpath')));
|
||||
$url = $siteurl . str_replace($siteurl, '', trim(get_settings('fileupload_url')));
|
||||
$path = str_replace(ABSPATH, '', trim(get_settings('upload_path')));
|
||||
$dir = ABSPATH . $path;
|
||||
$url = trailingslashit($siteurl) . $path;
|
||||
|
||||
if ( $dir == ABSPATH ) { //the option was empty
|
||||
$dir = ABSPATH . 'wp-content/uploads';
|
||||
}
|
||||
if ( $url == $siteurl ) { //the option was empty
|
||||
$url = get_option('siteurl') . '/' . str_replace(ABSPATH, '', $dir);
|
||||
}
|
||||
|
||||
if ( defined('UPLOADS') ) {
|
||||
$dir = ABSPATH . UPLOADS;
|
||||
$url = get_option('siteurl') . '/' . UPLOADS;
|
||||
$url = trailingslashit($siteurl) . UPLOADS;
|
||||
}
|
||||
|
||||
if ( get_settings('uploads_yearmonth_folders')) {
|
||||
if ( get_settings('uploads_use_yearmonth_folders')) {
|
||||
// Generate the yearly and monthly dirs
|
||||
$time = current_time( 'mysql' );
|
||||
$y = substr( $time, 0, 4 );
|
||||
|
||||
Reference in New Issue
Block a user