WordPress.org

Make WordPress Core

Changeset 47005


Ignore:
Timestamp:
12/22/2019 02:43:30 AM (7 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: When creating the .htaccess file in insert_with_markers(), make sure it has 0644 as a minimum set of permissions.

Props rcutmore, dd32, i3anaan.
Fixes #40572.

File:
1 edited

Legend:

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

    r46662 r47005  
    112112            return false;
    113113        }
     114
    114115        if ( ! touch( $filename ) ) {
    115116            return false;
     117        }
     118
     119        // Make sure the file is created with a minimum set of permissions.
     120        $perms = fileperms( $filename );
     121        if ( $perms ) {
     122            chmod( $filename, $perms | 0644 );
    116123        }
    117124    } elseif ( ! is_writeable( $filename ) ) {
Note: See TracChangeset for help on using the changeset viewer.