Преглед изворни кода

Set permissions when saving files

Fixes https://github.com/elrido/ZeroBin/issues/80
rugk пре 10 година
родитељ
комит
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);
         }