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:
parent
391beef707
commit
82495083c3
1 changed files with 5 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue