Merge pull request #31415 from knox/fix-opcache-permitted-path

Fix "Nextcloud is not allowed to use the OPcache API" warning
This commit is contained in:
MichaIng 2022-03-04 00:38:00 +01:00 committed by GitHub
commit fdf4024ccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -477,7 +477,7 @@ Raw output
// Check whether Nextcloud is allowed to use the OPcache API
$isPermitted = true;
$permittedPath = $this->iniGetWrapper->getString('opcache.restrict_api');
if (isset($permittedPath) && $permittedPath !== '' && !str_starts_with(\OC::$SERVERROOT, $permittedPath)) {
if (isset($permittedPath) && $permittedPath !== '' && !str_starts_with(\OC::$SERVERROOT, rtrim($permittedPath, '/'))) {
$isPermitted = false;
}