Fix permittedPath comparison

Signed-off-by: Mickey Knox <mickey@netfreaks.org>
This commit is contained in:
Mickey Knox 2022-03-02 22:35:04 +01:00 committed by Simon L. (Rebase PR Action)
parent 36860214f8
commit 4910724803

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;
}