mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +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 "SettingsDialog.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
#include "StringUtils.h"
|
||||||
|
#include <AK/URL.h>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
|
@ -43,7 +45,9 @@ void SettingsDialog::closeEvent(QCloseEvent* event)
|
||||||
|
|
||||||
void SettingsDialog::save()
|
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());
|
s_settings->set_new_tab_page(m_new_tab_page->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue