Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function testUrl($remote, $checkVersion = false) {
* @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);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,7 @@ private function shareProviderResharingRights(string $userId, IShare $share, $no

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) {
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/External/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct($options) {
$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;
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/templates/public.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<?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']) ?>)
Expand Down