Skip to content

Commit

Permalink
Don't suggest chmod to 777 (#373)
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Z. Yang <[email protected]>
  • Loading branch information
ezyang authored Apr 30, 2023
1 parent 43f49ac commit 6eb6123
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions library/HTMLPurifier/DefinitionCache/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,14 @@ private function _testPermissions($dir, $chmod)
} elseif (filegroup($dir) === posix_getgid()) {
$chmod = $chmod | 0070;
} else {
// PHP's probably running as nobody, so we'll
// need to give global permissions
$chmod = $chmod | 0777;
// PHP's probably running as nobody, it is
// not obvious how to fix this (777 is probably
// bad if you are multi-user), let the user figure it out
$chmod = null;
}
trigger_error(
'Directory ' . $dir . ' not writable, ' .
'please chmod to ' . decoct($chmod),
'Directory ' . $dir . ' not writable. ' .
($chmod === null ? '' : 'Please chmod to ' . decoct($chmod)),
E_USER_WARNING
);
} else {
Expand Down

0 comments on commit 6eb6123

Please sign in to comment.