added basic valid URL checks to cartridge links

This commit is contained in:
thrust26 2021-04-21 16:53:05 +02:00
parent d1a01391b0
commit b945e15adc
1 changed files with 6 additions and 1 deletions

View File

@ -1243,7 +1243,12 @@ void GameInfoDialog::eraseEEPROM()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void GameInfoDialog::updateLink()
{
myUrlButton->setEnabled(myUrl->getText() != EmptyString);
string link = myUrl->getText();
bool enable = startsWithIgnoreCase(link, "http://")
|| startsWithIgnoreCase(link, "https://")
|| startsWithIgnoreCase(link, "www.");
myUrlButton->setEnabled(enable);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -