aboutsummaryrefslogtreecommitdiffstats
path: root/include/connections.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-09-13 20:40:01 -0700
committerzotlabs <mike@macgirvin.com>2017-09-13 20:40:01 -0700
commitb5966041be46ab7a16dc1ee93b5a07c5461bc73c (patch)
tree123300e5f27d653074bee3fb4c8a859500e78042 /include/connections.php
parent62d6bada4c80a45e7e06f5dd1de599a5d039da76 (diff)
downloadvolse-hubzilla-b5966041be46ab7a16dc1ee93b5a07c5461bc73c.tar.gz
volse-hubzilla-b5966041be46ab7a16dc1ee93b5a07c5461bc73c.tar.bz2
volse-hubzilla-b5966041be46ab7a16dc1ee93b5a07c5461bc73c.zip
more zot6
Diffstat (limited to 'include/connections.php')
-rw-r--r--include/connections.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/connections.php b/include/connections.php
index a9f906649..0cf4cdc5a 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -629,13 +629,20 @@ function get_vcard_array($vc,$id) {
if($vc->ADR) {
foreach($vc->ADR as $adr) {
$type = (($adr['TYPE']) ? vcard_translate_type((string)$adr['TYPE']) : '');
- $adrs[] = [
+ $entry = [
'type' => $type,
'address' => $adr->getParts()
];
- $last_entry = end($adrs);
- if($last_entry && is_array($adrs[$last_entry]['address']))
- array_walk($adrs[$last_entry]['address'],'array_escape_tags');
+
+ if(is_array($entry['address'])) {
+ array_walk($entry['address'],'array_escape_tags');
+ }
+ else {
+ $entry['address'] = (string) escape_tags($entry['address']);
+ }
+
+ $adrs[] = $entry;
+
}
}