+2008-02-02 Helge Hess <helge.hess@opengroupware.org>
+
+ * DynamicElements/_WOComplexHyperlink.m: do not attempt to rewrite
+ pure fragment URLs (v4.7.19)
+
2007-11-26 Helge Hess <helge.hess@opengroupware.org>
* WOComponent+Sync.m: use -setValue:forKey: instead of
/*
- 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.
- (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;
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 ..."];