From: helge Date: Sat, 2 Feb 2008 10:32:14 +0000 (+0000) Subject: do not rewrite plain fragment URLs X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b4683870b86401407d110d0566d58f2a576871e;p=sope do not rewrite plain fragment URLs git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1595 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 02e3fc65..3c4fd7e9 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,8 @@ +2008-02-02 Helge Hess + + * DynamicElements/_WOComplexHyperlink.m: do not attempt to rewrite + pure fragment URLs (v4.7.19) + 2007-11-26 Helge Hess * WOComponent+Sync.m: use -setValue:forKey: instead of diff --git a/sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m b/sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m index ac5880bb..c263cbae 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m +++ b/sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m @@ -1,5 +1,6 @@ /* - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2000-2008 SKYRIX Software AG + Copyright (C) 2008 Helge Hess This file is part of SOPE. @@ -373,7 +374,14 @@ static BOOL debugStaticLinks = NO; - (BOOL)shouldRewriteURLString:(NSString *)_s inContext:(WOContext *)_ctx { // TODO: we need a binding to disable rewriting! NSRange r; + + r.length = [_s length]; + + /* do not rewrite pure fragment URLs */ + if (r.length > 0 && [_s characterAtIndex:0] == '#') + return false; + /* rewrite all URLs w/o a protocol */ r = [_s rangeOfString:@":"]; if (r.length == 0) return YES; @@ -410,10 +418,10 @@ static BOOL debugStaticLinks = NO; url = [NSURLClass URLWithString:s]; } else if (base != nil) { - /* avoid creating a new URL for ".", just return the base */ - url = [s isEqualToString:@"."] - ? base - : (NSURL *)[NSURLClass URLWithString:s relativeToURL:base]; + /* avoid creating a new URL for ".", just return the base */ + url = [s isEqualToString:@"."] + ? base + : (NSURL *)[NSURLClass URLWithString:s relativeToURL:base]; } else { [self warnWithFormat:@"missing base URL in context ..."]; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 07c9dd8f..d9b1994d 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=18 +SUBMINOR_VERSION:=19 # v4.7.11 requires libNGExtensions v4.7.194 # v4.5.234 requires libDOM v4.5.21