Changeset 12405
- Timestamp:
- 12/15/2009 05:53:51 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/schema.php
r12329 r12405 190 190 191 191 if ( ini_get('safe_mode') ) { 192 // Safe mode screws up mkdir(), so we must use a flat structure.192 // Safe mode can break mkdir() so use a flat structure by default. 193 193 $uploads_use_yearmonth_folders = 0; 194 $upload_path = WP_CONTENT_DIR;195 194 } else { 196 195 $uploads_use_yearmonth_folders = 1; 197 $upload_path = WP_CONTENT_DIR . '/uploads';198 196 } 199 197 … … 266 264 // 2.0.1 267 265 'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders, 268 'upload_path' => $upload_path,266 'upload_path' => '', 269 267 270 268 // 2.0.3 -
trunk/wp-admin/options-misc.php
r11781 r12405 31 31 <tr valign="top"> 32 32 <th scope="row"><label for="upload_path"><?php _e('Store uploads in this folder'); ?></label></th> 33 <td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( str_replace(ABSPATH, '', get_option('upload_path'))); ?>" class="regular-text code" />33 <td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr(get_option('upload_path')); ?>" class="regular-text code" /> 34 34 <span class="description"><?php _e('Default is <code>wp-content/uploads</code>'); ?></span> 35 35 </td> -
trunk/wp-includes/functions.php
r12403 r12405 2036 2036 $upload_path = get_option( 'upload_path' ); 2037 2037 $upload_path = trim($upload_path); 2038 if ( empty($upload_path) ) 2038 if ( empty($upload_path) ) { 2039 2039 $dir = WP_CONTENT_DIR . '/uploads'; 2040 else2040 } else { 2041 2041 $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 } 2045 2049 2046 2050 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 ) ) 2048 2052 $url = WP_CONTENT_URL . '/uploads'; 2049 2053 else
Note: See TracChangeset
for help on using the changeset viewer.