| 258 | } |
| 259 | |
| 260 | bool Url::ParseUserinfo(const String& userinfo) |
| 261 | { |
| 262 | size_t pos = userinfo.Find(":"); |
| 263 | m_Username = userinfo.SubStr(0, pos); |
| 264 | if (!ValidateToken(m_Username, ACUSERINFO)) |
| 265 | return false; |
| 266 | m_Username = Utility::UnescapeString(m_Username); |
| 267 | if (pos != String::NPos && pos != userinfo.GetLength() - 1) { |
| 268 | m_Password = userinfo.SubStr(pos+1); |
| 269 | if (!ValidateToken(m_Username, ACUSERINFO)) |
| 270 | return false; |
| 271 | m_Password = Utility::UnescapeString(m_Password); |
| 272 | } else |
| 273 | m_Password = ""; |
| 274 | |
| 275 | return true; |
| 276 | } |
| 277 | |
| 278 | bool Url::ParsePort(const String& port) |
| 279 | { |