diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-06-16 18:06:10 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-06-16 18:06:47 +0200 |
commit | 6642ef6a509417f61cffa51022a3192bdff69823 (patch) | |
tree | 8af938c8253a86a6296045f50e4195438948fcbb /apps/contacts/ajax | |
parent | a91e3d68b0727c4e3c93056b72161cfeaa3c09e9 (diff) | |
download | nextcloud-server-6642ef6a509417f61cffa51022a3192bdff69823.tar.gz nextcloud-server-6642ef6a509417f61cffa51022a3192bdff69823.zip |
Fix string encoding probs.
Diffstat (limited to 'apps/contacts/ajax')
-rw-r--r-- | apps/contacts/ajax/contacts.php | 2 | ||||
-rw-r--r-- | apps/contacts/ajax/editaddress.php | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php index 37d396cd83a..dbc9be5ca56 100644 --- a/apps/contacts/ajax/contacts.php +++ b/apps/contacts/ajax/contacts.php @@ -13,7 +13,7 @@ OCP\JSON::checkAppEnabled('contacts'); $ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $contacts = OC_Contacts_VCard::all($ids); $tmpl = new OCP\Template("contacts", "part.contacts"); -$tmpl->assign('contacts', $contacts); +$tmpl->assign('contacts', $contacts, false); $page = $tmpl->fetchPage(); OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/editaddress.php b/apps/contacts/ajax/editaddress.php index 969aeeba8f4..2d7aba11b0e 100644 --- a/apps/contacts/ajax/editaddress.php +++ b/apps/contacts/ajax/editaddress.php @@ -20,7 +20,18 @@ if($checksum) { $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); $element = $vcard->children[$line]; $adr = OC_Contacts_VCard::structureProperty($element); - $tmpl->assign('adr',$adr); + $types = array(); + if(isset($adr['parameters']['TYPE'])) { + if(is_array($adr['parameters']['TYPE'])) { + $types = array_map('htmlspecialchars', $adr['parameters']['TYPE']); + $types = array_map('strtoupper', $types); + } else { + $types = array(strtoupper(htmlspecialchars($adr['parameters']['TYPE']))); + } + } + $tmpl->assign('types', $types, false); + $adr = array_map('htmlspecialchars', $adr['value']); + $tmpl->assign('adr', $adr, false); } $tmpl->assign('id',$id); |