Просмотр исходного кода

Set permissions when saving files

Fixes https://github.com/elrido/ZeroBin/issues/80
rugk 10 лет назад
Родитель
Сommit
8a48e9ce78
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      lib/persistence.php

+ 1 - 0
lib/persistence.php

@@ -116,6 +116,7 @@ abstract class persistence
         self::_initialize();
         $file = self::$_path . DIRECTORY_SEPARATOR . $filename;
         $writtenBytes = @file_put_contents($file, $data, LOCK_EX);
+        chmod($file, 0640); // protect file access
         if ($writtenBytes === false || $writtenBytes < strlen($data)) {
             throw new Exception('unable to write to file ' . $file, 13);
         }