Wiki: Fix handling of url's without urls scheme

This commit is contained in:
Abs62 2018-03-11 16:33:17 +03:00
parent f2294ec3b6
commit 357638b033

View file

@ -538,6 +538,9 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r )
#endif #endif
QString( "<a href=\"%1/index.php?title=\\1" ).arg( url )); QString( "<a href=\"%1/index.php?title=\\1" ).arg( url ));
// Add url scheme to other urls like "//xxx"
articleString.replace( " href=\"//", " href=\"" + wikiUrl.scheme() + "://" );
QByteArray articleBody = articleString.toUtf8(); QByteArray articleBody = articleString.toUtf8();
articleBody.prepend( dictPtr->isToLanguageRTL() ? "<div class=\"mwiki\" dir=\"rtl\">" : articleBody.prepend( dictPtr->isToLanguageRTL() ? "<div class=\"mwiki\" dir=\"rtl\">" :