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,8 +538,11 @@ 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\">" :
"<div class=\"mwiki\">" ); "<div class=\"mwiki\">" );
articleBody.append( "</div>" ); articleBody.append( "</div>" );