Merge pull request #31437 from nextcloud/backport/31415/stable23

[stable23] Fix "Nextcloud is not allowed to use the OPcache API" warning
This commit is contained in:
Simon L 2022-03-08 13:47:52 +01:00 committed by GitHub
commit 227a0950d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -482,7 +482,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;
}