1
0
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:
Jimmy Hedman
2025-06-27 19:31:50 +02:00
committed by GitHub
parent c0b1f32889
commit 68d66c873e
23 changed files with 59 additions and 63 deletions

View File

@@ -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;
}