@@ -555,15 +555,21 @@ if (portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; _port = [[OFNumber alloc] initWithUnsignedShort: portString.unsignedLongLongValue]; - } else + } else { _URLEncodedHost = [[OFString alloc] initWithUTF8String: UTF8String]; - if (!isIPv6Host) + if (_URLEncodedHost.length == 0) { + [_URLEncodedHost release]; + _URLEncodedHost = nil; + } + } + + if (_URLEncodedHost != nil && !isIPv6Host) OFURLVerifyIsEscaped(_URLEncodedHost, [OFCharacterSet URLHostAllowedCharacterSet]); if ((UTF8String = tmp) != NULL) { if ((tmp = strchr(UTF8String, '#')) != NULL) {