1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:38:10 +00:00

Ladybird: Ensure selected new tab URL is a valid URL before saving

This commit is contained in:
Andrew Kaster 2023-08-07 14:54:36 -06:00 committed by Tim Flynn
parent 391beef707
commit 82495083c3

View file

@ -6,6 +6,8 @@
#include "SettingsDialog.h"
#include "Settings.h"
#include "StringUtils.h"
#include <AK/URL.h>
#include <QCloseEvent>
#include <QLabel>
@ -43,7 +45,9 @@ void SettingsDialog::closeEvent(QCloseEvent* event)
void SettingsDialog::save()
{
// FIXME: Validate data.
auto url_string = MUST(ak_string_from_qstring(m_new_tab_page->text()));
if (!URL(url_string).is_valid())
return;
s_settings->set_new_tab_page(m_new_tab_page->text());
}