mirror of
https://github.com/esphome/esphome.git
synced 2025-10-03 18:42:23 +01:00
Upgrade to use C++20 (#9135)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
@@ -344,7 +344,7 @@ void OnlineImage::end_connection_() {
|
||||
}
|
||||
|
||||
bool OnlineImage::validate_url_(const std::string &url) {
|
||||
if ((url.length() < 8) || (url.find("http") != 0) || (url.find("://") == std::string::npos)) {
|
||||
if ((url.length() < 8) || !url.starts_with("http") || (url.find("://") == std::string::npos)) {
|
||||
ESP_LOGE(TAG, "URL is invalid and/or must be prefixed with 'http://' or 'https://'");
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user