| 405 | } |
| 406 | |
| 407 | bool ValidateWebsite(string const & site) |
| 408 | { |
| 409 | if (site.empty()) |
| 410 | return true; |
| 411 | |
| 412 | auto const startPos = GetProtocolNameLength(site); |
| 413 | |
| 414 | // check lengt and leave room for addition of 'http://' |
| 415 | if (strings::CountChar(site) > (IsProtocolSpecified(site) ? kMaximumOsmChars : kMaximumOsmChars - 7)) |
| 416 | return false; |
| 417 | |
| 418 | if (startPos >= site.size()) |
| 419 | return false; |
| 420 | |
| 421 | // Site should contain at least one dot but not at the beginning/end. |
| 422 | if ('.' == site[startPos] || '.' == site.back()) |
| 423 | return false; |
| 424 | |
| 425 | if (string::npos == site.find('.')) |
| 426 | return false; |
| 427 | |
| 428 | if (string::npos != site.find("..")) |
| 429 | return false; |
| 430 | |
| 431 | return true; |
| 432 | } |
| 433 | |
| 434 | bool ValidateFacebookPage(string const & page) |
| 435 | { |