Making WordPress.org

Changeset 9995


Ignore:
Timestamp:
07/02/2020 07:35:55 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: When creating temporary files, use a second chmod() call to set them to world-writable as $mode on mkdir() respects the umask.

Fixes some PHP Notices that will be encountered on dev sites when PHP and CLI run as different users.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tools/class-filesystem.php

    r6026 r9995  
    2828        public static function temp_directory( $prefix = '' ) {
    2929                if ( ! is_dir( self::TMP_DIR ) ) {
    30                         mkdir( self::TMP_DIR, 0777 );
     30                        mkdir( self::TMP_DIR );
     31                        chmod( self::TMP_DIR, 0777 );
    3132                }
    3233
    … …  
    3637                // Replace that filename with a directory.
    3738                unlink( $tmp_dir );
    38                 mkdir( $tmp_dir, 0777 );
     39                mkdir( $tmp_dir );
     40                chmod( $tmp_dir, 0777 );
    3941
    4042                // Automatically remove this temporary directory on shutdown:
Note: See TracChangeset for help on using the changeset viewer.