Skip to content

Commit 0dc405d

Browse files
authored
[5.2] Fix fixFilesystemPermissions method in script.php for not existing folder (joomla#44483)
1 parent 816cd80 commit 0dc405d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

administrator/components/com_admin/script.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3541,13 +3541,15 @@ protected function fixFilesystemPermissions()
35413541
}
35423542

35433543
foreach ($folders as $folder) {
3544-
if (is_dir(JPATH_ROOT . $folder) && decoct(fileperms(JPATH_ROOT . $folder) & 0777) === '777') {
3545-
@chmod(JPATH_ROOT . $folder, 0755);
3546-
}
3544+
if (is_dir(JPATH_ROOT . $folder)) {
3545+
if (decoct(fileperms(JPATH_ROOT . $folder) & 0777) === '777') {
3546+
@chmod(JPATH_ROOT . $folder, 0755);
3547+
}
35473548

3548-
foreach (Folder::files(JPATH_ROOT . $folder, '.', false, true) as $file) {
3549-
if (decoct(fileperms($file) & 0777) === '777') {
3550-
@chmod($file, 0644);
3549+
foreach (Folder::files(JPATH_ROOT . $folder, '.', false, true) as $file) {
3550+
if (decoct(fileperms($file) & 0777) === '777') {
3551+
@chmod($file, 0644);
3552+
}
35513553
}
35523554
}
35533555
}

0 commit comments

Comments
 (0)