WordPress.org

Make WordPress Core

Ticket #40572: 40572.patch

File 40572.patch, 536 bytes (added by rcutmore, 2 years ago)

Modify .htaccess to a minimum set of permissions during creation

  • src/wp-admin/includes/misc.php

    diff --git src/wp-admin/includes/misc.php src/wp-admin/includes/misc.php
    index 679b9ac..480d2fb 100644
    function insert_with_markers( $filename, $marker, $insertion ) { 
    109109                if ( ! touch( $filename ) ) {
    110110                        return false;
    111111                }
     112                // Make sure file is created with a minimum set of permissions.
     113                if ( $perms = fileperms( $filename ) ) {
     114                        chmod( $filename, $perms | 0644 );
     115                }
    112116        } elseif ( ! is_writeable( $filename ) ) {
    113117                return false;
    114118        }