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. Built from https://develop.svn.wordpress.org/trunk@47005 git-svn-id: http://core.svn.wordpress.org/trunk@46805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -111,9 +111,16 @@ function insert_with_markers( $filename, $marker, $insertion ) {
|
||||
if ( ! is_writable( dirname( $filename ) ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! touch( $filename ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure the file is created with a minimum set of permissions.
|
||||
$perms = fileperms( $filename );
|
||||
if ( $perms ) {
|
||||
chmod( $filename, $perms | 0644 );
|
||||
}
|
||||
} elseif ( ! is_writeable( $filename ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user