[wp-trac] [WordPress Trac] #51340: Stop chmodding files and folders

WordPress Trac noreply at wordpress.org
Mon Mar 27 18:51:00 UTC 2023


#51340: Stop chmodding files and folders
----------------------------+------------------------------
 Reporter:  malthert        |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Filesystem API  |     Version:  5.3
 Severity:  major           |  Resolution:
 Keywords:  dev-feedback    |     Focuses:
----------------------------+------------------------------

Comment (by azaozz):

 Replying to [comment:12 costdev]:
 > In that case, we could just guard calls to these functions with
 `function_exists()` checks.
 > ...we would return true if the functions are disabled.
 > ...
 > It removes the need to add a filter or constant for each site on the
 server.

 Hmmm, not sure if returning `true` when `chmod()` was not run is good?
 Seems that having a `wp_chmod()` and a filter would make that more
 flexible, and perhaps more future-proof. Then plugins would be able to
 decide what to do when the PHP `chmod()` is disabled, or if permissions
 need to be changed at all when `chmod()` is not disabled. See:
 https://core.trac.wordpress.org/ticket/51340?replyto=12#comment:6.

 > For reference, uses of `chmod()` outside of the Filesystem API's
 `::chmod()` methods are:

 Yep, having a WP function will also reduce some code duplication, if
 nothing else :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51340#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list