From 6642ef6a509417f61cffa51022a3192bdff69823 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 16 Jun 2012 18:06:10 +0200 Subject: Fix string encoding probs. --- apps/contacts/ajax/contacts.php | 2 +- apps/contacts/ajax/editaddress.php | 13 ++++++++++++- apps/contacts/index.php | 2 +- apps/contacts/templates/part.contacts.php | 2 +- .../templates/part.edit_address_dialog.php | 22 +++++++++------------- 5 files changed, 24 insertions(+), 17 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); diff --git a/apps/contacts/index.php b/apps/contacts/index.php index 74b7c43c556..bdb52c123ce 100644 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -66,7 +66,7 @@ $tmpl->assign('phone_types', $phone_types); $tmpl->assign('email_types', $email_types); $tmpl->assign('categories', $categories); $tmpl->assign('addressbooks', $addressbooks); -$tmpl->assign('contacts', $contacts); +$tmpl->assign('contacts', $contacts, false); $tmpl->assign('details', $details ); $tmpl->assign('id',$id); $tmpl->printPage(); diff --git a/apps/contacts/templates/part.contacts.php b/apps/contacts/templates/part.contacts.php index 00a61f72fdd..57517505405 100644 --- a/apps/contacts/templates/part.contacts.php +++ b/apps/contacts/templates/part.contacts.php @@ -8,5 +8,5 @@ } } ?> -
  • +
  • diff --git a/apps/contacts/templates/part.edit_address_dialog.php b/apps/contacts/templates/part.edit_address_dialog.php index 7684795f348..d5ea95ba465 100644 --- a/apps/contacts/templates/part.edit_address_dialog.php +++ b/apps/contacts/templates/part.edit_address_dialog.php @@ -1,13 +1,9 @@
    -
    @@ -22,43 +18,43 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    -- cgit v1.2.3