#312677 by CorniI: Check to ensure a file exists when fixing installation file.

merge-requests/26/head
Angie Byron 2008-09-27 20:03:35 +00:00
parent 4a0e68e838
commit 42dda57f96
1 changed files with 5 additions and 0 deletions

View File

@ -733,6 +733,11 @@ function drupal_install_mkdir($file, $mask, $message = TRUE) {
* TRUE/FALSE whether or not we were able to fix the file's permissions.
*/
function drupal_install_fix_file($file, $mask, $message = TRUE) {
// If $file does not exist, fileperms() issues a PHP warning.
if (!file_exists($file)) {
return FALSE;
}
$mod = fileperms($file) & 0777;
$masks = array(FILE_READABLE, FILE_WRITABLE, FILE_EXECUTABLE, FILE_NOT_READABLE, FILE_NOT_WRITABLE, FILE_NOT_EXECUTABLE);