diff options
Diffstat (limited to 'apps/files_sharing')
4 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/Controller/ExternalSharesController.php b/apps/files_sharing/lib/Controller/ExternalSharesController.php index 9fab8d4e1a0..4cd09423eaa 100644 --- a/apps/files_sharing/lib/Controller/ExternalSharesController.php +++ b/apps/files_sharing/lib/Controller/ExternalSharesController.php @@ -129,7 +129,7 @@ class ExternalSharesController extends Controller { * @return DataResponse */ public function testRemote($remote) { - if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) { + if (str_contains($remote, '#') || str_contains($remote, '?') || str_contains($remote, ';')) { return new DataResponse(false); } diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 3287d9447d8..e9f0c465f36 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1841,7 +1841,7 @@ class ShareAPIController extends OCSController { if ($share->getShareType() === IShare::TYPE_CIRCLE && \OC::$server->getAppManager()->isEnabledForUser('circles') && class_exists('\OCA\Circles\Api\v1\Circles')) { - $hasCircleId = (substr($share->getSharedWith(), -1) === ']'); + $hasCircleId = (str_ends_with($share->getSharedWith(), ']')); $shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0); $shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' ')); if ($shareWithLength === false) { diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index f33334ca346..506a2f83c2d 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -78,7 +78,7 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage, $discoveryService = \OC::$server->query(\OCP\OCS\IDiscoveryService::class); [$protocol, $remote] = explode('://', $this->cloudId->getRemote()); - if (strpos($remote, '/')) { + if (str_contains($remote, '/')) { [$host, $root] = explode('/', $remote, 2); } else { $host = $remote; diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index abb3b195bc6..510a8d04e04 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -62,7 +62,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); <?php else: ?> <!-- preview frame to open file in with viewer --> <div id="imgframe"></div> - <?php if (isset($_['mimetype']) && strpos($_['mimetype'], 'image') === 0) { ?> + <?php if (isset($_['mimetype']) && str_starts_with($_['mimetype'], 'image')) { ?> <div class="directDownload"> <div> <?php p($_['filename'])?> (<?php p($_['fileSize']) ?>) |