Skip to content

Commit f0ff73f

Browse files
authored
Merge pull request #59544 from nextcloud/chore/remove-deprecated-methods
Remove long-time deprecated methods
2 parents ce5e5d4 + 9c51ed7 commit f0ff73f

File tree

18 files changed

+3
-464
lines changed

18 files changed

+3
-464
lines changed

lib/composer/composer/autoload_classmap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@
126126
'OCP\\AppFramework\\Http\\StandaloneTemplateResponse' => $baseDir . '/lib/public/AppFramework/Http/StandaloneTemplateResponse.php',
127127
'OCP\\AppFramework\\Http\\StreamResponse' => $baseDir . '/lib/public/AppFramework/Http/StreamResponse.php',
128128
'OCP\\AppFramework\\Http\\StreamTraversableResponse' => $baseDir . '/lib/public/AppFramework/Http/StreamTraversableResponse.php',
129-
'OCP\\AppFramework\\Http\\StrictContentSecurityPolicy' => $baseDir . '/lib/public/AppFramework/Http/StrictContentSecurityPolicy.php',
130-
'OCP\\AppFramework\\Http\\StrictEvalContentSecurityPolicy' => $baseDir . '/lib/public/AppFramework/Http/StrictEvalContentSecurityPolicy.php',
131-
'OCP\\AppFramework\\Http\\StrictInlineContentSecurityPolicy' => $baseDir . '/lib/public/AppFramework/Http/StrictInlineContentSecurityPolicy.php',
132129
'OCP\\AppFramework\\Http\\TemplateResponse' => $baseDir . '/lib/public/AppFramework/Http/TemplateResponse.php',
133130
'OCP\\AppFramework\\Http\\Template\\ExternalShareMenuAction' => $baseDir . '/lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php',
134131
'OCP\\AppFramework\\Http\\Template\\IMenuAction' => $baseDir . '/lib/public/AppFramework/Http/Template/IMenuAction.php',

lib/composer/composer/autoload_static.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
167167
'OCP\\AppFramework\\Http\\StandaloneTemplateResponse' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/StandaloneTemplateResponse.php',
168168
'OCP\\AppFramework\\Http\\StreamResponse' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/StreamResponse.php',
169169
'OCP\\AppFramework\\Http\\StreamTraversableResponse' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/StreamTraversableResponse.php',
170-
'OCP\\AppFramework\\Http\\StrictContentSecurityPolicy' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/StrictContentSecurityPolicy.php',
171-
'OCP\\AppFramework\\Http\\StrictEvalContentSecurityPolicy' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/StrictEvalContentSecurityPolicy.php',
172-
'OCP\\AppFramework\\Http\\StrictInlineContentSecurityPolicy' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/StrictInlineContentSecurityPolicy.php',
173170
'OCP\\AppFramework\\Http\\TemplateResponse' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/TemplateResponse.php',
174171
'OCP\\AppFramework\\Http\\Template\\ExternalShareMenuAction' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php',
175172
'OCP\\AppFramework\\Http\\Template\\IMenuAction' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Template/IMenuAction.php',

lib/private/Collaboration/Resources/Manager.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,6 @@ public function invalidateAccessCacheForProviderByUser(IProvider $provider, ?IUs
457457
$query->executeStatement();
458458
}
459459

460-
public function registerResourceProvider(string $provider): void {
461-
$this->logger->debug('\OC\Collaboration\Resources\Manager::registerResourceProvider is deprecated', ['provider' => $provider]);
462-
$this->providerManager->registerResourceProvider($provider);
463-
}
464-
465460
/**
466461
* Get the resource type of the provider
467462
*

lib/private/Notification/Manager.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,6 @@ public function registerApp(string $appClass): void {
9090
}
9191
}
9292

93-
/**
94-
* @param \Closure $service The service must implement INotifier, otherwise a
95-
* \InvalidArgumentException is thrown later
96-
* @param \Closure $info An array with the keys 'id' and 'name' containing
97-
* the app id and the app name
98-
* @deprecated 17.0.0 use registerNotifierService instead.
99-
* @since 8.2.0 - Parameter $info was added in 9.0.0
100-
*/
101-
public function registerNotifier(\Closure $service, \Closure $info): void {
102-
$infoData = $info();
103-
$exception = new \InvalidArgumentException(
104-
'Notifier ' . $infoData['name'] . ' (id: ' . $infoData['id'] . ') is not considered because it is using the old way to register.'
105-
);
106-
$this->logger->error($exception->getMessage(), ['exception' => $exception]);
107-
}
108-
10993
/**
11094
* @param string $notifierService The service must implement INotifier, otherwise a
11195
* \InvalidArgumentException is thrown later

lib/private/Security/CSP/ContentSecurityPolicy.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@ public function setInlineScriptAllowed(bool $inlineScriptAllowed): void {
2424
$this->inlineScriptAllowed = $inlineScriptAllowed;
2525
}
2626

27-
public function isEvalScriptAllowed(): bool {
28-
return $this->evalScriptAllowed;
29-
}
30-
31-
/**
32-
* @deprecated 17.0.0 Unsafe eval should not be used anymore.
33-
*/
34-
public function setEvalScriptAllowed(bool $evalScriptAllowed): void {
35-
$this->evalScriptAllowed = $evalScriptAllowed;
36-
}
37-
3827
public function isEvalWasmAllowed(): ?bool {
3928
return $this->evalWasmAllowed;
4029
}
@@ -115,21 +104,6 @@ public function setAllowedFontDomains($allowedFontDomains): void {
115104
$this->allowedFontDomains = $allowedFontDomains;
116105
}
117106

118-
/**
119-
* @deprecated 15.0.0 use FrameDomains and WorkerSrcDomains
120-
*/
121-
public function getAllowedChildSrcDomains(): array {
122-
return $this->allowedChildSrcDomains;
123-
}
124-
125-
/**
126-
* @param array $allowedChildSrcDomains
127-
* @deprecated 15.0.0 use FrameDomains and WorkerSrcDomains
128-
*/
129-
public function setAllowedChildSrcDomains($allowedChildSrcDomains): void {
130-
$this->allowedChildSrcDomains = $allowedChildSrcDomains;
131-
}
132-
133107
public function getAllowedFrameAncestors(): array {
134108
return $this->allowedFrameAncestors;
135109
}

lib/public/AppFramework/Http/ContentSecurityPolicy.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
class ContentSecurityPolicy extends EmptyContentSecurityPolicy {
2525
/** @var bool Whether inline JS snippets are allowed */
2626
protected $inlineScriptAllowed = false;
27-
/** @var bool Whether eval in JS scripts is allowed */
28-
protected $evalScriptAllowed = false;
2927
/** @var bool Whether WebAssembly compilation is allowed */
3028
protected ?bool $evalWasmAllowed = false;
3129
/** @var bool Whether strict-dynamic should be set */
@@ -69,8 +67,6 @@ class ContentSecurityPolicy extends EmptyContentSecurityPolicy {
6967
'\'self\'',
7068
'data:',
7169
];
72-
/** @var array Domains from which web-workers and nested browsing content can load elements */
73-
protected $allowedChildSrcDomains = [];
7470

7571
/** @var array Domains which can embed this Nextcloud instance */
7672
protected $allowedFrameAncestors = [

lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ class EmptyContentSecurityPolicy {
2424
protected $strictDynamicAllowed = null;
2525
/** @var bool Whether strict-dynamic should be used on script-src-elem */
2626
protected $strictDynamicAllowedOnScripts = null;
27-
/**
28-
* @var bool Whether eval in JS scripts is allowed
29-
* TODO: Disallow per default
30-
* @link https://github.com/owncloud/core/issues/11925
31-
*/
32-
protected $evalScriptAllowed = null;
3327
/** @var bool Whether WebAssembly compilation is allowed */
3428
protected ?bool $evalWasmAllowed = null;
3529
/** @var array Domains from which scripts can get loaded */
@@ -54,8 +48,6 @@ class EmptyContentSecurityPolicy {
5448
protected $allowedFrameDomains = null;
5549
/** @var array Domains from which fonts can be loaded */
5650
protected $allowedFontDomains = null;
57-
/** @var array Domains from which web-workers and nested browsing content can load elements */
58-
protected $allowedChildSrcDomains = null;
5951
/** @var array Domains which can embed this Nextcloud instance */
6052
protected $allowedFrameAncestors = null;
6153
/** @var array Domains from which web-workers can be loaded */
@@ -101,18 +93,6 @@ public function useJsNonce($nonce) {
10193
return $this;
10294
}
10395

104-
/**
105-
* Whether eval in JavaScript is allowed or forbidden
106-
* @param bool $state
107-
* @return $this
108-
* @since 8.1.0
109-
* @deprecated 17.0.0 Eval should not be used anymore. Please update your scripts. This function will stop functioning in a future version of Nextcloud.
110-
*/
111-
public function allowEvalScript($state = true) {
112-
$this->evalScriptAllowed = $state;
113-
return $this;
114-
}
115-
11696
/**
11797
* Whether WebAssembly compilation is allowed or forbidden
11898
* @param bool $state
@@ -323,31 +303,6 @@ public function disallowFrameDomain($domain) {
323303
return $this;
324304
}
325305

326-
/**
327-
* Domains from which web-workers and nested browsing content can load elements
328-
* @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized.
329-
* @return $this
330-
* @since 8.1.0
331-
* @deprecated 15.0.0 use addAllowedWorkerSrcDomains or addAllowedFrameDomain
332-
*/
333-
public function addAllowedChildSrcDomain($domain) {
334-
$this->allowedChildSrcDomains[] = $domain;
335-
return $this;
336-
}
337-
338-
/**
339-
* Remove the specified allowed child src domain from the allowed domains.
340-
*
341-
* @param string $domain
342-
* @return $this
343-
* @since 8.1.0
344-
* @deprecated 15.0.0 use the WorkerSrcDomains or FrameDomain
345-
*/
346-
public function disallowChildSrcDomain($domain) {
347-
$this->allowedChildSrcDomains = array_diff($this->allowedChildSrcDomains, [$domain]);
348-
return $this;
349-
}
350-
351306
/**
352307
* Domains which can embed an iFrame of the Nextcloud instance
353308
*
@@ -441,7 +396,7 @@ public function buildPolicy() {
441396
$policy .= "base-uri 'none';";
442397
$policy .= "manifest-src 'self';";
443398

444-
if (!empty($this->allowedScriptDomains) || $this->evalScriptAllowed || $this->evalWasmAllowed || is_string($this->jsNonce)) {
399+
if (!empty($this->allowedScriptDomains) || $this->evalWasmAllowed || is_string($this->jsNonce)) {
445400
$policy .= 'script-src ';
446401
$scriptSrc = '';
447402
if (is_string($this->jsNonce)) {
@@ -459,9 +414,6 @@ public function buildPolicy() {
459414
if (is_array($this->allowedScriptDomains)) {
460415
$scriptSrc .= implode(' ', $this->allowedScriptDomains);
461416
}
462-
if ($this->evalScriptAllowed) {
463-
$scriptSrc .= ' \'unsafe-eval\'';
464-
}
465417
if ($this->evalWasmAllowed) {
466418
$scriptSrc .= ' \'wasm-unsafe-eval\'';
467419
}
@@ -517,11 +469,6 @@ public function buildPolicy() {
517469
$policy .= ';';
518470
}
519471

520-
if (!empty($this->allowedChildSrcDomains)) {
521-
$policy .= 'child-src ' . implode(' ', $this->allowedChildSrcDomains);
522-
$policy .= ';';
523-
}
524-
525472
if (!empty($this->allowedFrameAncestors)) {
526473
$policy .= 'frame-ancestors ' . implode(' ', $this->allowedFrameAncestors);
527474
$policy .= ';';

lib/public/AppFramework/Http/StrictContentSecurityPolicy.php

Lines changed: 0 additions & 70 deletions
This file was deleted.

lib/public/AppFramework/Http/StrictEvalContentSecurityPolicy.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

lib/public/AppFramework/Http/StrictInlineContentSecurityPolicy.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)