[wp-trac] [WordPress Trac] #12350: Check folder permissions before uploading file

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 9 14:54:04 UTC 2011


#12350: Check folder permissions before uploading file
-------------------------------------+------------------------------
 Reporter:  not2bug                  |       Owner:
     Type:  enhancement              |      Status:  reopened
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Administration           |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  upload media permission  |
-------------------------------------+------------------------------

Comment (by asdasDan):

 Well in response to the /wp-content versus ./wp-content. I believe
 wordpress if it were to validate it would validate the path off of
 ABSPATH, so /wp-content/uploads would work.

 This code was able to fix it on line 150 of wp-admin/options.php:

 {{{
  if ( $option == 'upload_path' && !file_exists(ABSPATH . $value) ) {
         add_settings_error('general', 'path-does-not-exist', __('Media
 Uploads Folder does not exist.'), 'error');
  } elseif ( $option == 'upload_path' && !is_readable(ABSPATH . $value) ) {
         add_settings_error('general', 'path-not-readable', __('Media
 Uploads Folder is not readable.'), 'error');
  }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12350#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list