1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

changed chmod behaviour in Serializer

This commit is contained in:
Nick del Pozo
2016-07-27 12:56:03 +09:00
parent d0c392f77d
commit 8be8cee9b3
2 changed files with 7 additions and 15 deletions

View File

@@ -198,10 +198,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac
if ($result !== false) {
// set permissions of the new file (no execute)
$chmod = $config->get('Cache.SerializerPermissions');
if ($chmod === null) {
// don't do anything
} else {
$chmod = $chmod & 0666;
if ($chmod !== null) {
chmod($file, $chmod);
}
}
@@ -229,14 +226,6 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac
} elseif (!$this->_testPermissions($base, $chmod)) {
return false;
}
if ($chmod === null) {
trigger_error(
'Base directory ' . $base . ' does not exist,
please create or change using %Cache.SerializerPath',
E_USER_WARNING
);
return false;
}
if ($chmod !== null) {
mkdir($directory, $chmod);
} else {