Skip to content

Commit

Permalink
[5.2] Fix fixFilesystemPermissions method in script.php for not exist…
Browse files Browse the repository at this point in the history
…ing folder (joomla#44483)
  • Loading branch information
richard67 authored Nov 19, 2024
1 parent 816cd80 commit 0dc405d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -3541,13 +3541,15 @@ protected function fixFilesystemPermissions()
}

foreach ($folders as $folder) {
if (is_dir(JPATH_ROOT . $folder) && decoct(fileperms(JPATH_ROOT . $folder) & 0777) === '777') {
@chmod(JPATH_ROOT . $folder, 0755);
}
if (is_dir(JPATH_ROOT . $folder)) {
if (decoct(fileperms(JPATH_ROOT . $folder) & 0777) === '777') {
@chmod(JPATH_ROOT . $folder, 0755);
}

foreach (Folder::files(JPATH_ROOT . $folder, '.', false, true) as $file) {
if (decoct(fileperms($file) & 0777) === '777') {
@chmod($file, 0644);
foreach (Folder::files(JPATH_ROOT . $folder, '.', false, true) as $file) {
if (decoct(fileperms($file) & 0777) === '777') {
@chmod($file, 0644);
}
}
}
}
Expand Down

0 comments on commit 0dc405d

Please sign in to comment.