Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6eb6123

Browse files
authored
Don't suggest chmod to 777 (#373)
Signed-off-by: Edward Z. Yang <[email protected]>
1 parent 43f49ac commit 6eb6123

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

library/HTMLPurifier/DefinitionCache/Serializer.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,14 @@ private function _testPermissions($dir, $chmod)
287287
} elseif (filegroup($dir) === posix_getgid()) {
288288
$chmod = $chmod | 0070;
289289
} else {
290-
// PHP's probably running as nobody, so we'll
291-
// need to give global permissions
292-
$chmod = $chmod | 0777;
290+
// PHP's probably running as nobody, it is
291+
// not obvious how to fix this (777 is probably
292+
// bad if you are multi-user), let the user figure it out
293+
$chmod = null;
293294
}
294295
trigger_error(
295-
'Directory ' . $dir . ' not writable, ' .
296-
'please chmod to ' . decoct($chmod),
296+
'Directory ' . $dir . ' not writable. ' .
297+
($chmod === null ? '' : 'Please chmod to ' . decoct($chmod)),
297298
E_USER_WARNING
298299
);
299300
} else {

0 commit comments

Comments
 (0)