[wp-trac] [WordPress Trac] #20330: Differences between creating folders for plugins and uploaded media (problem with safe_mode)

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 4 16:26:09 UTC 2012


#20330: Differences between creating folders for plugins and uploaded media
(problem with safe_mode)
--------------------------+------------------------------
 Reporter:  pavelevap     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Upload        |     Version:  3.3.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by pavelevap):

 I tried to bypass this problem and found a partial solution.

 WordPress wants to create directory "uploads/2012/04", but only "uploads"
 is created with another group and owner. I wrote a small plugin which uses
 Filesystem API and tries to hook to upload_dir filter to create folders
 with using "ftpext" method.

 But, there are 2 problems:

 1) In order to preserve current "uploads" folder, I should have change
 group and owner of "uploads" folder. But using ftpext there are chown()
 and chgrp() functions which everytime return false. I am not sure if it is
 possible to change group and owner of "uploads" folder by using ftpext
 method?

 2) When I tried to hook to upload_dir, I can created special folder "wp-
 content/smuploads", but also original "wp-content/uploads" is
 automatically created. Is it possible not to create it?

 Any ideas?

 Still there is main problem - WordPress is useless when using safe_mode
 and uploading media. Maybe there should be any error message to emphasize
 this problem on uploading screen when safe_mode on?

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


More information about the wp-trac mailing list