0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-09 23:28:42 +00:00

rollback change to permissions

This commit is contained in:
Nick del Pozo 2016-07-29 08:56:36 +09:00
parent 8be8cee9b3
commit 1f982d279f
2 changed files with 4 additions and 7 deletions

View File

@ -199,7 +199,7 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac
// set permissions of the new file (no execute)
$chmod = $config->get('Cache.SerializerPermissions');
if ($chmod !== null) {
chmod($file, $chmod);
chmod($file, $chmod & 0666);
}
}
return $result;

View File

@ -23,7 +23,6 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio
$rel_file = HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer/Test/' .
$config_md5 . '.ser'
);
if($file && file_exists($file)) unlink($file); // prevent previous failures from causing problems
$this->assertIdentical($config_md5, $cache->generateKey($config));
@ -216,12 +215,10 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio
$def_original = $this->generateDefinition();
$cache->add($def_original, $config);
$this->assertFileExist($dir . '/Test/1.0.0,serial,1.ser');
$file_path = $dir . '/Test/1.0.0,serial,1.ser';
$this->assertFileExist($file_path);
$file_permissions = substr(sprintf("%o",fileperms($file_path)),-4);;
$this->assertEqual("0700", $file_permissions);
$this->assertEqual(0600, 0777 & fileperms($dir . '/Test/1.0.0,serial,1.ser'));
$this->assertEqual(0700, 0777 & fileperms($dir . '/Test'));
unlink($dir . '/Test/1.0.0,serial,1.ser');
rmdir( $dir . '/Test');