[wp-trac] [WordPress Trac] #10424: change get_filesystem_method()'s code for direct to reflect actual purpose

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 18 13:42:48 UTC 2009


#10424: change get_filesystem_method()'s code for direct to reflect actual purpose
--------------------------+-------------------------------------------------
 Reporter:  dd32          |       Owner:  dd32       
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  2.9        
Component:  Filesystem    |     Version:  2.9        
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------
Changes (by sivel):

 * cc: matt@… (added)


Comment:

 I'm thinking that perhaps we should also do an is_writable check as well.
 This may actually make the check more restrictive but possibly more
 accurate.

 {{{
 if ( file_owner($temp_file) !== false && file_owner(__FILE__) ===
 file_owner($temp_file) && is_writable($temp_file) && is_writable(__FILE__)
 ) {
 //use direct
 }
 }}}

 This could help us avoid issues where the default umask doesn't give write
 permissions to the owner, which I have seen in cases where the file is
 created by the web server user on more restrictive setups.

 This would also help to explain via code that we are checking more than
 just if the file is writable.  Comments would still need to be included to
 describe the check more thoroughly and referring the user to the filter
 where they could define their own check and the constant to avoid the
 check all together.

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


More information about the wp-trac mailing list