From f72436aa0a2d3c466e836b5a76e72e48a402540f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Mar 2021 14:41:58 +0100 Subject: [PATCH] [libcalamaresui] Drop RE-wrangling, compare hosts instead to detect valid paste URL --- src/libcalamaresui/utils/Paste.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp index 230199311..cdf8cc17b 100644 --- a/src/libcalamaresui/utils/Paste.cpp +++ b/src/libcalamaresui/utils/Paste.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -95,12 +94,11 @@ ficheLogUpload( QObject* parent ) QUrl pasteUrl = QUrl( QString( responseText ).trimmed(), QUrl::StrictMode ); QString pasteUrlStr = pasteUrl.toString(); - QRegularExpression pasteUrlRegex( "^http[s]?://" + ficheHost ); QString pasteUrlFmt = parent->tr( "Install log posted to\n\n%1\n\nLink copied to clipboard" ); QString pasteUrlMsg = pasteUrlFmt.arg( pasteUrlStr ); - if ( pasteUrl.isValid() && pasteUrlRegex.match( pasteUrlStr ).hasMatch() ) + if ( pasteUrl.isValid() && pasteUrl.host() == ficheHost ) { QClipboard* clipboard = QApplication::clipboard(); clipboard->setText( pasteUrlStr, QClipboard::Clipboard );