Skip to content

Commit 36a1004

Browse files
committed
Update fixpermissions.php to support public directory
1 parent de5e71d commit 36a1004

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

fixpermissions.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,20 @@
8484

8585
// find out full names of the executables
8686
foreach ($executables as $relname) {
87-
$realpath = realpath("$sourcedir/$relname");
88-
if ($realpath !== false) {
89-
$executables[$realpath] = $relname;
90-
} else {
91-
echo "Can not find real path for $relname in git repository\n";
92-
exit(1);
87+
$realpath = realpath("$sourcedir/public/$relname");
88+
89+
// If the path doesn't exist, it may be a legacy branch that doesn't use the 'public/' prefix.
90+
// This fallback will be necessary until 4.5 (LTS) falls out of security support (6 Oct 2027).
91+
if ($realpath === false) {
92+
$realpath = realpath("$sourcedir/$relname");
9393
}
94-
if (!file_exists($realpath)) {
95-
echo "Can not find executable file $realpath in git repository\n";
94+
95+
if ($realpath === false) {
96+
echo "Can not find real path for $relname in git repository\n";
9697
exit(1);
9798
}
99+
100+
$executables[$realpath] = $relname;
98101
}
99102

100103
// These files may not exist in all the branches, so we are adding them now, after

0 commit comments

Comments
 (0)