l10n->t('Font file loading'); } public function run(): SetupResult { $result = $this->checkFont('otf', $this->urlGenerator->linkTo('theming', 'fonts/OpenDyslexic-Regular.otf')); if ($result->getSeverity() !== SetupResult::SUCCESS) { return $result; } return $this->checkFont('woff2', $this->urlGenerator->linkTo('', 'core/fonts/NotoSans-Regular-latin.woff2')); } protected function checkFont(string $fileExtension, string $url): SetupResult { $noResponse = true; $responses = $this->runRequest('HEAD', $url); foreach ($responses as $response) { $noResponse = false; if ($response->getStatusCode() === 200) { return SetupResult::success(); } } if ($noResponse) { return SetupResult::info( str_replace( '{extension}', $fileExtension, $this->l10n->t('Could not check for {extension} loading support. Please check manually if your webserver serves `.{extension}` files.') . "\n" . $this->serverConfigHelp(), ), $this->urlGenerator->linkToDocs('admin-nginx'), ); } return SetupResult::warning( str_replace( '{extension}', $fileExtension, $this->l10n->t('Your web server is not properly set up to deliver .{extension} files. This is typically an issue with the Nginx configuration. For Nextcloud 15 it needs an adjustment to also deliver .{extension} files. Compare your Nginx configuration to the recommended configuration in our documentation.'), ), $this->urlGenerator->linkToDocs('admin-nginx'), ); } }