aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/HasPhotoPlugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CardDAV/HasPhotoPlugin.php')
-rw-r--r--apps/dav/lib/CardDAV/HasPhotoPlugin.php28
1 files changed, 4 insertions, 24 deletions
diff --git a/apps/dav/lib/CardDAV/HasPhotoPlugin.php b/apps/dav/lib/CardDAV/HasPhotoPlugin.php
index a77a75c6cc6..6e2e0423910 100644
--- a/apps/dav/lib/CardDAV/HasPhotoPlugin.php
+++ b/apps/dav/lib/CardDAV/HasPhotoPlugin.php
@@ -3,29 +3,9 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- * @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-
namespace OCA\DAV\CardDAV;
use Sabre\CardDAV\Card;
@@ -67,8 +47,8 @@ class HasPhotoPlugin extends ServerPlugin {
return $vcard instanceof VCard
&& $vcard->PHOTO
// Either the PHOTO is a url (doesn't start with data:) or the mimetype has to start with image/
- && (strpos($vcard->PHOTO->getValue(), 'data:') !== 0
- || strpos($vcard->PHOTO->getValue(), 'data:image/') === 0)
+ && (!str_starts_with($vcard->PHOTO->getValue(), 'data:')
+ || str_starts_with($vcard->PHOTO->getValue(), 'data:image/'))
;
});
}