mail/roundcube-carddav: fix unparenthesized deprecation warn in php74

Reported by:	David Gessel <gessel@blackrosetech.com>
Obtained from:	https://github.com/mstilkerich/rcmcarddav/commit/b66791
This commit is contained in:
Pietro Cerutti 2020-12-10 10:41:36 +00:00
parent b27fb28f77
commit 966e11b026
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=557426
2 changed files with 21 additions and 0 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= carddav
PORTVERSION= 3.0.3
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= https://github.com/blind-coder/rcmcarddav/releases/download/v${PORTVERSION}/
PKGNAMEPREFIX= roundcube-

View File

@ -0,0 +1,20 @@
--- carddav.php.orig 2020-12-10 08:52:54 UTC
+++ carddav.php
@@ -349,8 +349,15 @@ class carddav extends rcube_plugin
if (self::no_override('username', $abook, $prefs)) {
// %V parses username for macosx, replaces periods and @ by _, work around bugs in contacts.app
- $content_username = $abook['username'] === '%V' ? str_replace('@','_', str_replace('.','_',$_SESSION['username'])) : $abook['username'] === '%u' ? $_SESSION['username'] : $abook['username'] === '%l' ? $rcmail->user->get_username('local') : $abook['username'];
-
+ if ($abook['username'] === '%V') {
+ $content_username = str_replace('@','_', str_replace('.','_',$_SESSION['username']));
+ } elseif ($abook['username'] === '%u') {
+ $content_username = $_SESSION['username'];
+ } elseif ($abook['username'] === '%l') {
+ $content_username = $rcmail->user->get_username('local');
+ } else {
+ $content_username = $abook['username'];
+ }
} else {
// input box for username
$input = new html_inputfield(array('name' => $abookid.'_cd_username', 'type' => 'text', 'autocomplete' => 'off', 'value' => $abook['username']));