66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
}
- (void)setHost: (OFString *)host
{
void *pool = objc_autoreleasePoolPush();
OFString *old = _URLEncodedHost;
_URLEncodedHost = [[host stringByURLEncodingWithAllowedCharacters:
[OFCharacterSet URLHostAllowedCharacterSet]] copy];
[old release];
objc_autoreleasePoolPop(pool);
}
- (void)setURLEncodedHost: (OFString *)URLEncodedHost
{
OFString *old;
if (URLEncodedHost != nil)
of_url_verify_escaped(URLEncodedHost,
[OFCharacterSet URLHostAllowedCharacterSet]);
old = _URLEncodedHost;
_URLEncodedHost = [URLEncodedHost copy];
[old release];
}
|
>
>
>
>
|
>
|
>
>
>
>
>
|
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
}
- (void)setHost: (OFString *)host
{
void *pool = objc_autoreleasePoolPush();
OFString *old = _URLEncodedHost;
if (of_url_is_ipv6_host(host))
_URLEncodedHost = [[OFString alloc]
initWithFormat: @"[%@]", host];
else
_URLEncodedHost = [[host
stringByURLEncodingWithAllowedCharacters:
[OFCharacterSet URLHostAllowedCharacterSet]] copy];
[old release];
objc_autoreleasePoolPop(pool);
}
- (void)setURLEncodedHost: (OFString *)URLEncodedHost
{
OFString *old;
if ([URLEncodedHost hasPrefix: @"["] &&
[URLEncodedHost hasSuffix: @"]"]) {
if (!of_url_is_ipv6_host([URLEncodedHost substringWithRange:
of_range(1, URLEncodedHost.length - 2)]))
@throw [OFInvalidFormatException exception];
} else if (URLEncodedHost != nil)
of_url_verify_escaped(URLEncodedHost,
[OFCharacterSet URLHostAllowedCharacterSet]);
old = _URLEncodedHost;
_URLEncodedHost = [URLEncodedHost copy];
[old release];
}
|