Ticket #2802: wp_handle_upload-file-permissions-patch-2.diff
| File wp_handle_upload-file-permissions-patch-2.diff, 783 bytes (added by Libertus, 7 years ago) |
|---|
-
wp-admin/admin-functions.php
1883 1883 // Move the file to the uploads dir 1884 1884 $new_file = $uploads['path'] . "/$filename"; 1885 1885 if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) ) 1886 die(printf(__('The uploaded file could not be moved to %s.'), $ file['path']));1886 die(printf(__('The uploaded file could not be moved to %s.'), $uploads['path'])); 1887 1887 1888 1888 // Set correct file permissions 1889 1889 $stat = stat(dirname($new_file)); 1890 $perms = $stat['mode'] & 0 000666;1890 $perms = $stat['mode'] & 0664; // never executable, never world-writable 1891 1891 @ chmod($new_file, $perms); 1892 1892 1893 1893 // Compute the URL
