Skip to content

Commit 1be4b4f

Browse files
authored
Merge pull request #7559 from BennyBPB/4.4
perf: Change current directory in public/index.php only if necessary
2 parents 7d3b36a + cd4fbe1 commit 1be4b4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

public/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
1717

1818
// Ensure the current directory is pointing to the front controller's directory
19-
chdir(FCPATH);
19+
if (getcwd() . DIRECTORY_SEPARATOR !== FCPATH) {
20+
chdir(FCPATH);
21+
}
2022

2123
/*
2224
*---------------------------------------------------------------

0 commit comments

Comments
 (0)