Skip to content

feat: Nextcloud 33 compatibility (NC 31–33, PHP 8.2–8.5)#174

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/explore-codebase-nextcloud-compatibility
Open

feat: Nextcloud 33 compatibility (NC 31–33, PHP 8.2–8.5)#174
Copilot wants to merge 3 commits into
mainfrom
copilot/explore-codebase-nextcloud-compatibility

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 23, 2026

Brings the app into compliance with Nextcloud 33 requirements: drops PHP 8.1 (removed in NC33), adds PHP 8.5, bumps supported NC range to 31–33, and eliminates all internal OC\* API usage.

Breaking fixes (PHP 8.2+ / NC33)

  • FILTER_SANITIZE_STRING removed — replaced with direct casts in AdminSettingsController; added explicit whitelist validation in getCustomization() so unknown provider names return HTTP 400 instead of silently falling through
  • OC\Security\CSP\ContentSecurityPolicyOCP\AppFramework\Http\ContentSecurityPolicy
  • OC_DefaultsOCP\Defaults in PersonalSettings and SettingsService
  • use OC\AppFramework\Http\Request — removed from four provider files where it was imported but never used

HTTP client modernisation

Replaced all raw curl_* and file_get_contents() calls with Nextcloud's IClientService (respects proxy config, SSL settings, and the new NC33 user-agent). IClientService is injected into the Provider base class and propagated through ProviderDefinitionsSettingsService:

// Before
protected function getData($host) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $host);
    // ...
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}

// After
protected function getData(string $host): string|false {
    try {
        return $this->clientService->newClient()->get($host)->getBody();
    } catch (\Exception $e) {
        $this->logger->warning('Failed to fetch data from ' . $host . ': ' . $e->getMessage());
        return false;
    }
}

All concrete providers (WikimediaCommons, WikimediaCommonsDaily, WallhavenCC) now call $this->getData() instead of direct curl_init(). BingWallpaperDaily switches from file_get_contents() to the same.

Dead code removal

  • NC ≤28 core.login.showLoginForm route case removed from BeforeTemplateRenderedEventListener (NC ≥29 lowercase form is the only one needed)
  • getNextcloudVersion() helper and the > 26 / > 19 version guards removed — always true on NC 31+
  • hasDashboard template conditional removed; dashboard has been present since NC 20
  • Dead LegacyInitialisationService import removed from Application.php

Version bump

appinfo/info.xml: 3.1.03.2.0, NC 26–3231–33, PHP 8.0–8.48.2–8.5

Copilot AI and others added 3 commits April 23, 2026 14:57
… dead code cleanup

Agent-Logs-Url: https://github.com/nextcloud/unsplash/sessions/7e0896b2-5c33-4d74-a979-fa2e6d6cda1b

Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants