diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-06-29 14:40:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-29 14:40:26 +0200 |
commit | 7b7148c206c2a15d497124c6e7dbac082e6a7a20 (patch) | |
tree | 9265126a43c39d4dfca61683754a20fb9abea062 /lib | |
parent | fc3ac4d97428d7a4b00a48bd72d1945a646d39b8 (diff) | |
parent | d2efd0e03cb0f30b748b86c324fc574e603334aa (diff) | |
download | nextcloud-server-7b7148c206c2a15d497124c6e7dbac082e6a7a20.tar.gz nextcloud-server-7b7148c206c2a15d497124c6e7dbac082e6a7a20.zip |
Merge pull request #35915 from nextcloud/enh/noid/display-name-federated-shares
display displayname on federated shares
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Federation/CloudIdManager.php | 9 | ||||
-rw-r--r-- | lib/public/Federation/ICloudIdManager.php | 10 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/private/Federation/CloudIdManager.php b/lib/private/Federation/CloudIdManager.php index 01e00c01181..22b06af386f 100644 --- a/lib/private/Federation/CloudIdManager.php +++ b/lib/private/Federation/CloudIdManager.php @@ -209,11 +209,12 @@ class CloudIdManager implements ICloudIdManager { * @param string $url * @return string */ - private function removeProtocolFromUrl($url) { + public function removeProtocolFromUrl(string $url): string { if (str_starts_with($url, 'https://')) { - return substr($url, strlen('https://')); - } elseif (str_starts_with($url, 'http://')) { - return substr($url, strlen('http://')); + return substr($url, 8); + } + if (str_starts_with($url, 'http://')) { + return substr($url, 7); } return $url; diff --git a/lib/public/Federation/ICloudIdManager.php b/lib/public/Federation/ICloudIdManager.php index 1612c03ba4a..52920751739 100644 --- a/lib/public/Federation/ICloudIdManager.php +++ b/lib/public/Federation/ICloudIdManager.php @@ -62,4 +62,14 @@ interface ICloudIdManager { * @since 12.0.0 */ public function isValidCloudId(string $cloudId): bool; + + /** + * remove scheme/protocol from an url + * + * @param string $url + * + * @return string + * @since 28.0.0 + */ + public function removeProtocolFromUrl(string $url): string; } |