From 8717a569108ba5885c07814b84231c0ccb3ab8d2 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Wed, 24 Jun 2015 17:50:14 +0300 Subject: [PATCH] MediaWiki engine: Fix resource urls for SSL connection (issue #609) --- mediawiki.cc | 13 +++++++------ webmultimediadownload.cc | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mediawiki.cc b/mediawiki.cc index 544a11da..9e9e5a60 100644 --- a/mediawiki.cc +++ b/mediawiki.cc @@ -369,10 +369,11 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r ) // audio url articleString.replace( QRegExp( "dictPtr->getId() )+ "dictPtr->getId() ) + "]*(upload\\.wikimedia\\.org/wikipedia/commons/[^\"'&]*\\.ogg)[^>]*>\\s*<[^<]*"), - QString::fromStdString(addAudioLink("\"http://\\1\"",this->dictPtr->getId())+ - "\"Play\"")); + articleString.replace( QRegExp( "]*(upload\\.wikimedia\\.org/wikipedia/commons/[^\"'&]*\\.ogg)[^>]*>\\s*<[^<]*"), + QString::fromStdString(addAudioLink( string( "\"" ) + wikiUrl.scheme().toStdString() + "://\\1\"", this->dictPtr->getId() ) + + "\"Play\"" ) ); // In those strings, change any underscores to spaces for( ; ; ) { diff --git a/webmultimediadownload.cc b/webmultimediadownload.cc index 01557e7b..326c3c46 100644 --- a/webmultimediadownload.cc +++ b/webmultimediadownload.cc @@ -49,7 +49,7 @@ bool WebMultimediaDownload::isAudioUrl( QUrl const & url ) { // Note: we check for forvo sound links explicitly, as they don't have extensions - return url.scheme() == "http" && ( + return ( url.scheme() == "http" || url.scheme() == "https" ) && ( Filetype::isNameOfSound( url.path().toUtf8().data() ) || url.host() == "apifree.forvo.com" ); }