Validate Pastebin URL with regex
This commit is contained in:
parent
af20b5ee0e
commit
0eff21a4f1
@ -30,7 +30,9 @@ PastePage::PastePage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::PastePage)
|
||||
{
|
||||
static QRegularExpression validUrlRegExp("https?://.+");
|
||||
ui->setupUi(this);
|
||||
ui->urlChoices->setValidator(new QRegularExpressionValidator(validUrlRegExp, ui->urlChoices));
|
||||
ui->tabWidget->tabBar()->hide();\
|
||||
loadSettings();
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
<property name="title">
|
||||
<string>Pastebin URL</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
@ -46,6 +46,21 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Note: only input that starts with <span style=" font-weight:600;">http://</span> or <span style=" font-weight:600;">https://</span> will be accepted.</p></body></html></string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="urlChoices">
|
||||
<property name="editable">
|
||||
@ -69,7 +84,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Here you can choose from a predefined list, or input the URL of a different paste service, provided that it supports the same protocol as 0x0.st, that is POST a file to the URL and return a link in the response body.</p></body></html></string>
|
||||
<string><html><head/><body><p>Here you can choose from a predefined list of paste services, or input the URL of a different paste service of your choice, provided it supports the same protocol as 0x0.st, that is POST a file parameter to the URL and return a link in the response body.</p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
|
Loading…
Reference in New Issue
Block a user