From 9452204f5ca63fd68ed050bcf0f3b2d1ba3ff6e1 Mon Sep 17 00:00:00 2001 From: rfc2822 Date: Sat, 29 Nov 2014 22:52:51 +0100 Subject: [PATCH] Bug fixes * fix a bug in handling TXT records (hopefully fixes #383) * fix invalid translation strings --- res/values-ca/strings.xml | 4 ++-- src/at/bitfire/davdroid/resource/DavResourceFinder.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index 5cccb365..64132a6c 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -111,7 +111,7 @@ Afegir compte Contactant servidor. Espereu sisuplau. - Quines col·leccions s'han de sincronitzar? + Quines col·leccions s\'han de sincronitzar? Llibretes de contactes Llibreta de contactes Calendaris @@ -136,7 +136,7 @@ Registra el tràfic de xarxa Tot el tràfic de xarxa es reigstra (mode depuració) No es registra el tràfic de xarxa - Informa d'un error + Informa d\'un error diff --git a/src/at/bitfire/davdroid/resource/DavResourceFinder.java b/src/at/bitfire/davdroid/resource/DavResourceFinder.java index 76e330d5..843ac2d0 100644 --- a/src/at/bitfire/davdroid/resource/DavResourceFinder.java +++ b/src/at/bitfire/davdroid/resource/DavResourceFinder.java @@ -202,12 +202,14 @@ public class DavResourceFinder implements Closeable { records = new Lookup(name, Type.TXT).run(); if (records != null && records.length >= 1) { TXTRecord txt = (TXTRecord)records[0]; - for (String segment : (String[])txt.getStrings().toArray()) + for (Object o : txt.getStrings().toArray()) { + String segment = (String)o; if (segment.startsWith("path=")) { path = segment.substring(5); Log.d(TAG, "Found initial context path for " + serviceName + " at " + domain + " -> " + path); break; } + } } } } catch (TextParseException e) { @@ -234,7 +236,6 @@ public class DavResourceFinder implements Closeable { if (initialURL != null) { // determine base URL (host name and initial context path) WebDavResource base = new WebDavResource(httpClient, - //new URI(URIUtils.ensureTrailingSlash(serverInfo.getBaseURI())), initialURL, serverInfo.getUserName(), serverInfo.getPassword(), serverInfo.isAuthPreemptive());