WordPress.org

Make WordPress Core

Changeset 25469


Ignore:
Timestamp:
09/17/2013 08:05:23 AM (6 years ago)
Author:
dd32
Message:

WordPress Upgrades: When defining the default filesystem permissions for files/directories, base the value on the existing ABSPATH & index.php file permissions - so as to respect the executable bit (if set) and not set global read if not required.
This sets a minimum permission set to 750 and 640 for directories and files, so any systems requring less permission than that will still need to define the constants themselves. Fixes #20069

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r25347 r25469  
    803803    // Set the permission constants if not already set.
    804804    if ( ! defined('FS_CHMOD_DIR') )
    805         define('FS_CHMOD_DIR', 0755 );
     805        define('FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0750 ) );
    806806    if ( ! defined('FS_CHMOD_FILE') )
    807         define('FS_CHMOD_FILE', 0644 );
     807        define('FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0640 ) );
    808808
    809809    return true;
Note: See TracChangeset for help on using the changeset viewer.