From a546268c7a08ff75fef5ec08b54297257e13509c Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 3 Sep 2013 23:40:10 +0200 Subject: [PATCH] * Don't whitelist youtube urls. They won't work. --- src/libtomahawk/utils/TomahawkUtils.cpp | 4 ++-- src/libtomahawk/utils/TomahawkUtils.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/utils/TomahawkUtils.cpp b/src/libtomahawk/utils/TomahawkUtils.cpp index 5d7d233cc..e5892b82f 100644 --- a/src/libtomahawk/utils/TomahawkUtils.cpp +++ b/src/libtomahawk/utils/TomahawkUtils.cpp @@ -773,10 +773,10 @@ extractBinaryResolver( const QString& zipFilename, QObject* receiver ) bool -whitelistedHttpResultHint( const QString& url ) +whitelistedHttpResultHint( const QUrl& url ) { // For now, just http/https - return url.startsWith( "http" ); + return ( url.scheme().startsWith( "http" ) && !url.host().endsWith( "youtube.com" ) ); } diff --git a/src/libtomahawk/utils/TomahawkUtils.h b/src/libtomahawk/utils/TomahawkUtils.h index e533dcf0a..28e23bb75 100644 --- a/src/libtomahawk/utils/TomahawkUtils.h +++ b/src/libtomahawk/utils/TomahawkUtils.h @@ -179,7 +179,7 @@ namespace TomahawkUtils // Used by the above, not exported void copyWithAuthentication( const QString& srcFile, const QDir dest, QObject* receiver ); - DLLEXPORT bool whitelistedHttpResultHint( const QString& url ); + DLLEXPORT bool whitelistedHttpResultHint( const QUrl& url ); DLLEXPORT int compareVersionStrings( const QString& first, const QString& second );