From 83d03b8ee7d9f86abb62213281fa50c161a6097e Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Fri, 8 Jun 2018 15:10:26 -0400 Subject: [PATCH] Fix #245: Files default to unwritable when permissions are changed in the file browser --- bureau/class/m_bro.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bureau/class/m_bro.php b/bureau/class/m_bro.php index f0994b2b..874c4f1e 100644 --- a/bureau/class/m_bro.php +++ b/bureau/class/m_bro.php @@ -559,6 +559,12 @@ class m_bro { } for ($i = 0; $i < count($d); $i++) { $d[$i] = ssla($d[$i]); // strip slashes if needed + // If the form checkboxes are not checked, PHP will not fill in a + // value at all for the permissions. Set the default to unwriteable + // unless explicitly marked as writable. + if (!isset($perm[$i])) { + $perm[$i]['w'] = False; + } if (!strpos($d[$i], "/")) { // caractre / interdit dans le nom du fichier $m = fileperms($absolute . "/" . $d[$i]);