Revisión | ee61786391717368972adcc9802dfa14b0be2786 (tree) |
---|---|
Tiempo | 2017-09-07 22:33:28 |
Autor | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2427 Control data file permission
@@ -15,6 +15,9 @@ define('PKWK_MAXSHOW_CACHE', 'recent.dat'); | ||
15 | 15 | // AutoLink |
16 | 16 | define('PKWK_AUTOLINK_REGEX_CACHE', 'autolink.dat'); |
17 | 17 | |
18 | +// File mode for pkwk_touch | |
19 | +//define('PKWK_DATA_FILE_PERMS', 0644); | |
20 | + | |
18 | 21 | // Get source(wiki text) data of the page |
19 | 22 | // Returns FALSE if error occurerd |
20 | 23 | function get_source($page = NULL, $lock = TRUE, $join = FALSE) |
@@ -859,6 +862,9 @@ function pkwk_touch_file($filename, $time = FALSE, $atime = FALSE) | ||
859 | 862 | } else { |
860 | 863 | $result = touch($filename, $time, $atime); |
861 | 864 | } |
865 | + if (defined('PKWK_DATA_FILE_PERMS')) { | |
866 | + chmod($filename, PKWK_DATA_FILE_PERMS); | |
867 | + } | |
862 | 868 | return $result; |
863 | 869 | } else { |
864 | 870 | die('pkwk_touch_file(): Invalid UID and (not writable for the directory or not a flie): ' . |