From: helge Date: Sun, 3 Oct 2004 16:25:28 +0000 (+0000) Subject: fix in URL processing X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab38fe12df9d19ff0b77ab75b3d50301227a8c8;p=sope fix in URL processing git-svn-id: http://svn.opengroupware.org/SOPE/trunk@219 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index f799bb5c..47f5bd19 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,8 @@ +2004-10-03 Helge Hess + + * FdExt.subproj/NSURL+misc.m: fixed URL processing in some edge case + (v4.3.120) + 2004-10-02 Helge Hess * NGQuotedPrintableCoding.m: minor code cleanups (v4.3.119) diff --git a/sope-core/NGExtensions/FdExt.subproj/NSURL+misc.m b/sope-core/NGExtensions/FdExt.subproj/NSURL+misc.m index 7870f2de..e7dad368 100644 --- a/sope-core/NGExtensions/FdExt.subproj/NSURL+misc.m +++ b/sope-core/NGExtensions/FdExt.subproj/NSURL+misc.m @@ -94,7 +94,8 @@ static BOOL debugURLProcessing = NO; NSString *relPath; if (_base == self || _base == nil) { - relPath = [[self pathWithCorrectTrailingSlash] urlPathRelativeToSelf]; + relPath = [self pathWithCorrectTrailingSlash]; + relPath = [relPath urlPathRelativeToSelf]; relPath = [self stringByAddingFragmentAndQueryToPath:relPath]; if (debugURLProcessing) { NSLog(@"%s: no base or base is self => '%@'", @@ -192,14 +193,18 @@ static BOOL isEqual(id o1, id o2) { */ NSString *p; NSString *lp; + + /* + /SOGo/so/X/Mail/Y/INBOX/withsubdirs/ + ..//SOGo/so/X/Mail/Y/INBOX/withsubdirs// + */ p = self; lp = [p lastPathComponent]; + if (![p hasSuffix:@"/"]) + return lp; - p = ([p hasSuffix:@"/"]) - ? [NSString stringWithFormat:@"../%@/", p] - : lp; - return p; + return [[@"../" stringByAppendingString:lp] stringByAppendingString:@"/"]; } - (NSString *)urlPathRelativeToRoot { diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 1dfd267e..bf24f267 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=119 +SUBMINOR_VERSION:=120 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39