/*
- Copyright (C) 2000-2004 SKYRIX Software AG
+ Copyright (C) 2000-2005 SKYRIX Software AG
- This file is part of OpenGroupware.org.
+ This file is part of SOPE.
- OGo is free software; you can redistribute it and/or modify it under
+ SOPE is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with OGo; see the file COPYING. If not, write to the
+ License along with SOPE; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
}
static inline BOOL isUrlSafeChar(unsigned char _c) {
switch (_c) {
- case '$': case '-': case '_': case '.': case '+':
+ case '$': case '-': case '_': case '.':
+#if 0 /* see OGo bug #1260, required for forms */
+ case '+':
+#endif
case '@': // TODO: not a safe char?!
return YES;
}
else { // any other char is escaped ..
*_dest = '%'; _dest++;
- sprintf(_dest, "%02X", (unsigned)*src);
+ sprintf((char *)_dest, "%02X", (unsigned)*src);
_dest += 2;
}
}
- (NSString *)stringByUnescapingURL {
/*
- input is a URL string - per definition ASCII(?!), like "hello%98%88.txt"
+ Input is a URL string - per definition ASCII(?!), like "hello%98%88.txt"
output is a unicode string (never longer than the input)
Note that the input itself is in some encoding! That is, the input is
cstr[len] = '\0';
buffer = malloc(len + 4);
- NGUnescapeUrlBuffer(cstr, buffer);
+ NGUnescapeUrlBuffer((unsigned char *)cstr, (unsigned char *)buffer);
if (doUseUTF8Encoding()) {
/* OK, the input is considered UTF-8 encoded in a string */
s = [[NSString alloc] initWithUTF8String:buffer];
- if (buffer) free(buffer);
+ if (buffer != NULL) free(buffer); buffer = NULL;
}
else {
s = [[NSString alloc]
length:strlen(buffer)
freeWhenDone:YES];
}
- if (cstr) free(cstr);
+ if (cstr != NULL) free(cstr); cstr = NULL;
return [s autorelease];
}
return @"";
buffer = malloc(len * 3 + 2);
- NGEscapeUrlBuffer([data bytes], buffer, len);
+ NGEscapeUrlBuffer([data bytes], (unsigned char *)buffer, len);
}
else {
unsigned char *cstr;
len = [self cStringLength];
cstr = malloc(len + 4);
- [self getCString:cstr]; // Unicode!
+ [self getCString:(char *)cstr]; // Unicode!
cstr[len] = '\0';
buffer = malloc(len * 3 + 2);
- NGEscapeUrlBuffer(cstr, buffer, len);
+ NGEscapeUrlBuffer(cstr, (unsigned char *)buffer, len);
if (cstr) free(cstr);
}