Kaynağa Gözat

Verify that all strings are properly escaped (#5558)

- I checked every occurence of a '%2' and make correct use of the
QString::arg overload that takes several argument instead of chaining
them, because the first argument can contains a '%1'

 - I tried to look for every label that they either use plain text or richtext
and escape the user provided strings in there.
Olivier Goffart 9 yıl önce
ebeveyn
işleme
7bfe061382

+ 11 - 7
src/gui/accountsettings.cpp

@@ -552,10 +552,12 @@ void AccountSettings::slotAccountStateChanged(int state)
             _model->slotUpdateFolderState(folder);
         }
 
-        QString server = QString::fromLatin1("<a href=\"%1\">%2</a>").arg(account->url().toString(), safeUrl.toString());
+        QString server = QString::fromLatin1("<a href=\"%1\">%2</a>")
+                             .arg(Utility::escape(account->url().toString()),
+                                  Utility::escape(safeUrl.toString()));
         QString serverWithUser = server;
         if (AbstractCredentials *cred = account->credentials()) {
-           serverWithUser = tr("%1 as <i>%2</i>").arg(server, cred->user());
+            serverWithUser = tr("%1 as <i>%2</i>").arg(server, Utility::escape(cred->user()));
         }
 
         if (state == AccountState::Connected) {
@@ -569,13 +571,14 @@ void AccountSettings::slotAccountStateChanged(int state)
         } else if (state == AccountState::SignedOut) {
             showConnectionLabel( tr("Signed out from %1.").arg(serverWithUser) );
         } else {
-            showConnectionLabel( tr("No connection to %1 at %2.")
-                                 .arg(Theme::instance()->appNameGUI(),
-                                      server), _accountState->connectionErrors() );
+            showConnectionLabel(tr("No connection to %1 at %2.")
+                                    .arg(Utility::escape(Theme::instance()->appNameGUI()), server),
+                                _accountState->connectionErrors());
         }
     } else {
         // ownCloud is not yet configured.
-        showConnectionLabel( tr("No %1 connection configured.").arg(Theme::instance()->appNameGUI()) );
+        showConnectionLabel(tr("No %1 connection configured.")
+                                .arg(Utility::escape(Theme::instance()->appNameGUI())));
     }
 
     /* Allow to expand the item if the account is connected. */
@@ -664,7 +667,8 @@ void AccountSettings::refreshSelectiveSyncStatus()
             }
             QModelIndex theIndx = _model->indexForPath(folder, myFolder);
             if(theIndx.isValid()) {
-                msg += QString::fromLatin1("<a href=\"%1?folder=%2\">%1</a>").arg(myFolder).arg(folder->alias());
+                msg += QString::fromLatin1("<a href=\"%1?folder=%2\">%1</a>")
+                           .arg(Utility::escape(myFolder), Utility::escape(folder->alias()));
             } else {
                 msg += myFolder; // no link because we do not know the index yet.
             }

+ 9 - 0
src/gui/accountsettings.ui

@@ -41,6 +41,9 @@
         <property name="text">
          <string>Connected with &lt;server&gt; as &lt;user&gt;</string>
         </property>
+        <property name="textFormat">
+         <enum>Qt::RichText</enum>
+        </property>
         <property name="wordWrap">
          <bool>true</bool>
         </property>
@@ -75,6 +78,9 @@
        <property name="text">
         <string>Storage space: ...</string>
        </property>
+       <property name="textFormat">
+        <enum>Qt::PlainText</enum>
+       </property>
        <property name="wordWrap">
         <bool>false</bool>
        </property>
@@ -145,6 +151,9 @@
           <property name="text">
            <string>Unchecked folders will be &lt;b&gt;removed&lt;/b&gt; from your local file system and will not be synchronized to this computer anymore</string>
           </property>
+          <property name="textFormat">
+           <enum>Qt::RichText</enum>
+          </property>
           <property name="wordWrap">
            <bool>true</bool>
           </property>

+ 2 - 2
src/gui/activityitemdelegate.cpp

@@ -142,9 +142,9 @@ void ActivityItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
 
     QString timeStr;
     if ( accountOnline ) {
-        timeStr = tr("%1 on %2").arg(timeText).arg(accountRole);
+        timeStr = tr("%1 on %2").arg(timeText, accountRole);
     } else {
-        timeStr = tr("%1 on %2 (disconnected)").arg(timeText).arg(accountRole);
+        timeStr = tr("%1 on %2 (disconnected)").arg(timeText, accountRole);
         QPalette p = option.palette;
         painter->setPen(p.color(QPalette::Disabled, QPalette::Text));
     }

+ 9 - 0
src/gui/activitywidget.ui

@@ -25,6 +25,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::PlainText</enum>
+     </property>
     </widget>
    </item>
    <item row="1" column="0">
@@ -64,6 +67,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
     </widget>
    </item>
    <item row="3" column="0">
@@ -87,6 +93,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
     </widget>
    </item>
    <item row="5" column="0">

+ 1 - 0
src/gui/authenticationdialog.cpp

@@ -30,6 +30,7 @@ AuthenticationDialog::AuthenticationDialog(const QString &realm, const QString &
     setWindowTitle(tr("Authentication Required"));
     QVBoxLayout *lay = new QVBoxLayout(this);
     QLabel *label = new QLabel(tr("Enter username and password for '%1' at %2.").arg(realm, domain));
+    label->setTextFormat(Qt::PlainText);
     lay->addWidget(label);
 
     QFormLayout *form = new QFormLayout;

+ 4 - 4
src/gui/folder.cpp

@@ -383,16 +383,16 @@ void Folder::createGuiLog( const QString& filename, LogStatus status, int count,
             break;
         case LogStatusRename:
             if( count > 1 ) {
-                text = tr("%1 has been renamed to %2 and %n other file(s) have been renamed.", "", count-1).arg(file).arg(renameTarget);
+                text = tr("%1 has been renamed to %2 and %n other file(s) have been renamed.", "", count-1).arg(file, renameTarget);
             } else {
-                text = tr("%1 has been renamed to %2.", "%1 and %2 name files.").arg(file).arg(renameTarget);
+                text = tr("%1 has been renamed to %2.", "%1 and %2 name files.").arg(file, renameTarget);
             }
             break;
         case LogStatusMove:
             if( count > 1 ) {
-                text = tr("%1 has been moved to %2 and %n other file(s) have been moved.", "", count-1).arg(file).arg(renameTarget);
+                text = tr("%1 has been moved to %2 and %n other file(s) have been moved.", "", count-1).arg(file, renameTarget);
             } else {
-                text = tr("%1 has been moved to %2.").arg(file).arg(renameTarget);
+                text = tr("%1 has been moved to %2.").arg(file, renameTarget);
             }
             break;
         case LogStatusConflict:

+ 2 - 1
src/gui/folderstatusmodel.cpp

@@ -164,10 +164,11 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
     {
         const auto &x = static_cast<SubFolderInfo *>(index.internalPointer())->_subs[index.row()];
         switch (role) {
-        case Qt::ToolTipRole:
         case Qt::DisplayRole:
             //: Example text: "File.txt (23KB)"
             return x._size < 0 ? x._name : tr("%1 (%2)").arg(x._name, Utility::octetsToString(x._size));
+        case Qt::ToolTipRole:
+            return QString(QLatin1String("<qt>") + Utility::escape(x._size < 0 ? x._name : tr("%1 (%2)").arg(x._name, Utility::octetsToString(x._size))) + QLatin1String("</qt>"));
         case Qt::CheckStateRole:
             return x._checked;
         case Qt::DecorationRole:

+ 3 - 2
src/gui/folderwizard.cpp

@@ -65,7 +65,7 @@ FolderWizardLocalPath::FolderWizardLocalPath(const AccountPtr& account)
     connect(_ui.localFolderChooseBtn, SIGNAL(clicked()), this, SLOT(slotChooseLocalFolder()));
     _ui.localFolderChooseBtn->setToolTip(tr("Click to select a local folder to sync."));
 
-    QString defaultPath = QString::fromLatin1( "%1/%2").arg( QDir::homePath() ).arg(Theme::instance()->appName() );
+    QString defaultPath = QDir::homePath() + QLatin1Char('/') + Theme::instance()->appName();
     _ui.localFolderLineEdit->setText( QDir::toNativeSeparators( defaultPath ) );
     _ui.localFolderLineEdit->setToolTip(tr("Enter the path to the local folder."));
 
@@ -441,7 +441,8 @@ bool FolderWizardRemotePath::isComplete() const
         if (QDir::cleanPath(dir) == QDir::cleanPath(curDir)) {
             warnStrings.append(tr("This folder is already being synced."));
         } else if (dir.startsWith(curDir + QLatin1Char('/'))) {
-            warnStrings.append(tr("You are already syncing <i>%1</i>, which is a parent folder of <i>%2</i>.").arg(curDir).arg(dir));
+            warnStrings.append(tr("You are already syncing <i>%1</i>, which is a parent folder of <i>%2</i>.").arg(
+                Utility::escape(curDir), Utility::escape(dir)));
         }
 
         if (curDir == QLatin1String("/")) {

+ 1 - 1
src/gui/folderwizardsourcepage.ui

@@ -126,7 +126,7 @@
       <string/>
      </property>
      <property name="textFormat">
-      <enum>Qt::AutoText</enum>
+      <enum>Qt::RichText</enum>
      </property>
      <property name="margin">
       <number>3</number>

+ 1 - 1
src/gui/folderwizardtargetpage.ui

@@ -110,7 +110,7 @@
            <string>TextLabel</string>
           </property>
           <property name="textFormat">
-           <enum>Qt::AutoText</enum>
+           <enum>Qt::RichText</enum>
           </property>
           <property name="wordWrap">
            <bool>true</bool>

+ 6 - 0
src/gui/owncloudsetuppage.ui

@@ -35,6 +35,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
     </widget>
    </item>
    <item row="3" column="0" colspan="2">
@@ -155,6 +158,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
     </widget>
    </item>
    <item row="5" column="1">

+ 23 - 19
src/gui/owncloudsetupwizard.cpp

@@ -178,10 +178,10 @@ void OwncloudSetupWizard::slotOwnCloudFoundAuth(const QUrl& url, const QVariantM
     auto serverVersion = CheckServerJob::version(info);
 
     _ocWizard->appendToConfigurationLog(tr("<font color=\"green\">Successfully connected to %1: %2 version %3 (%4)</font><br/><br/>")
-                                        .arg(url.toString())
-                                        .arg(Theme::instance()->appNameGUI())
-                                        .arg(CheckServerJob::versionString(info))
-                                        .arg(serverVersion));
+                                        .arg(Utility::escape(url.toString()),
+                                             Utility::escape(Theme::instance()->appNameGUI()),
+                                             Utility::escape(CheckServerJob::versionString(info)),
+                                             Utility::escape(serverVersion)));
 
     _ocWizard->account()->setServerVersion(serverVersion);
 
@@ -212,9 +212,9 @@ void OwncloudSetupWizard::slotNoOwnCloudFoundAuth(QNetworkReply *reply)
         msg = tr("Invalid URL");
     } else {
         msg = tr("Failed to connect to %1 at %2:<br/>%3")
-            .arg(Theme::instance()->appNameGUI(),
-                 reply->url().toString(),
-                 reply->errorString());
+                  .arg(Utility::escape(Theme::instance()->appNameGUI()),
+                       Utility::escape(reply->url().toString()),
+                       Utility::escape(reply->errorString()));
     }
     bool isDowngradeAdvised = checkDowngradeAdvised(reply);
 
@@ -244,9 +244,10 @@ void OwncloudSetupWizard::slotNoOwnCloudFoundAuth(QNetworkReply *reply)
 
 void OwncloudSetupWizard::slotNoOwnCloudFoundAuthTimeout(const QUrl&url)
 {
-    _ocWizard->displayError(tr("Timeout while trying to connect to %1 at %2.")
-                            .arg(Theme::instance()->appNameGUI(),
-                                 url.toString()), false);
+    _ocWizard->displayError(
+        tr("Timeout while trying to connect to %1 at %2.")
+            .arg(Utility::escape(Theme::instance()->appNameGUI()), Utility::escape(url.toString())),
+        false);
 }
 
 void OwncloudSetupWizard::slotConnectToOCUrl( const QString& url )
@@ -307,7 +308,7 @@ void OwncloudSetupWizard::slotAuthError()
         }
         errorMsg = tr("The authenticated request to the server was redirected to "
                       "'%1'. The URL is bad, the server is misconfigured.")
-                   .arg(redirectUrl.toString());
+                       .arg(Utility::escape(redirectUrl.toString()));
 
     // A 404 is actually a success: we were authorized to know that the folder does
     // not exist. It will be created later...
@@ -320,7 +321,7 @@ void OwncloudSetupWizard::slotAuthError()
         if (!_ocWizard->account()->credentials()->stillValid(reply)) {
             errorMsg = tr("Access forbidden by server. To verify that you have proper access, "
                           "<a href=\"%1\">click here</a> to access the service with your browser.")
-                       .arg(_ocWizard->account()->url().toString());
+                           .arg(Utility::escape(_ocWizard->account()->url().toString()));
         } else {
             errorMsg = errorMessage(reply->errorString(), reply->readAll());
         }
@@ -369,7 +370,9 @@ void OwncloudSetupWizard::slotCreateLocalAndRemoteFolders(const QString& localFo
     if( fi.exists() ) {
         // there is an existing local folder. If its non empty, it can only be synced if the
         // ownCloud is newly created.
-        _ocWizard->appendToConfigurationLog( tr("Local sync folder %1 already exists, setting it up for sync.<br/><br/>").arg(localFolder));
+        _ocWizard->appendToConfigurationLog(
+            tr("Local sync folder %1 already exists, setting it up for sync.<br/><br/>")
+                .arg(Utility::escape(localFolder)));
     } else {
         QString res = tr("Creating local sync folder %1...").arg(localFolder);
         if( fi.mkpath( localFolder ) ) {
@@ -379,7 +382,7 @@ void OwncloudSetupWizard::slotCreateLocalAndRemoteFolders(const QString& localFo
         } else {
             res += tr("failed.");
             qDebug() << "Failed to create " << fi.path();
-            _ocWizard->displayError(tr("Could not create local folder %1").arg(localFolder), false);
+            _ocWizard->displayError(tr("Could not create local folder %1").arg(Utility::escape(localFolder)), false);
             nextStep = false;
         }
         _ocWizard->appendToConfigurationLog( res );
@@ -415,7 +418,7 @@ void OwncloudSetupWizard::slotRemoteFolderExists(QNetworkReply *reply)
     }
 
     if( !ok ) {
-        _ocWizard->displayError(error, false);
+        _ocWizard->displayError(Utility::escape(error), false);
     }
 
     finalizeSetup( ok );
@@ -455,8 +458,8 @@ void OwncloudSetupWizard::slotCreateRemoteFolderFinished( QNetworkReply::Network
         _remoteFolder.clear();
         success = false;
     } else {
-        _ocWizard->appendToConfigurationLog( tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(_remoteFolder).arg(error));
-        _ocWizard->displayError( tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(_remoteFolder).arg(error), false );
+        _ocWizard->appendToConfigurationLog( tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(Utility::escape(_remoteFolder)).arg(error));
+        _ocWizard->displayError( tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(Utility::escape(_remoteFolder)).arg(error), false );
         _remoteFolder.clear();
         success = false;
     }
@@ -472,8 +475,9 @@ void OwncloudSetupWizard::finalizeSetup( bool success )
     const QString localFolder = _ocWizard->property("localFolder").toString();
     if( success ) {
         if( !(localFolder.isEmpty() || _remoteFolder.isEmpty() )) {
-            _ocWizard->appendToConfigurationLog( tr("A sync connection from %1 to remote directory %2 was set up.")
-                                                 .arg(localFolder).arg(_remoteFolder));
+            _ocWizard->appendToConfigurationLog(
+                tr("A sync connection from %1 to remote directory %2 was set up.")
+                    .arg(localFolder, _remoteFolder));
         }
         _ocWizard->appendToConfigurationLog( QLatin1String(" "));
         _ocWizard->appendToConfigurationLog( QLatin1String("<p><font color=\"green\"><b>")

+ 3 - 0
src/gui/protocolwidget.ui

@@ -19,6 +19,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::PlainText</enum>
+     </property>
     </widget>
    </item>
    <item row="1" column="0" colspan="2">

+ 3 - 0
src/gui/proxyauthdialog.ui

@@ -73,6 +73,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::PlainText</enum>
+     </property>
     </widget>
    </item>
   </layout>

+ 1 - 2
src/gui/proxyauthhandler.cpp

@@ -58,8 +58,7 @@ void ProxyAuthHandler::handleProxyAuthenticationRequired(
         return;
     }
 
-    QString key = QString::fromLatin1("%1:%2").arg(
-            proxy.hostName(), QString::number(proxy.port()));
+    QString key = proxy.hostName() + QLatin1Char(':') + QString::number(proxy.port());
 
     // If the proxy server has changed, forget what we know.
     if (key != _proxy) {

+ 1 - 1
src/gui/settingsdialog.cpp

@@ -252,7 +252,7 @@ void SettingsDialog::customizeStyle()
     QString altBase(palette().alternateBase().color().name());
     QString dark(palette().dark().color().name());
     QString background(palette().base().color().name());
-    _toolBar->setStyleSheet(QString::fromAscii(TOOLBAR_CSS).arg(background).arg(dark).arg(highlightColor).arg(altBase));
+    _toolBar->setStyleSheet(QString::fromAscii(TOOLBAR_CSS).arg(background,dark,highlightColor,altBase));
 
     Q_FOREACH(QAction *a, _actionGroup->actions()) {
         QIcon icon = createColorAwareIcon(a->property("iconPath").toString());

+ 6 - 0
src/gui/sharedialog.ui

@@ -27,6 +27,9 @@
        <property name="text">
         <string>share label</string>
        </property>
+       <property name="textFormat">
+        <enum>Qt::PlainText</enum>
+       </property>
       </widget>
      </item>
      <item row="1" column="1">
@@ -46,6 +49,9 @@
        <property name="text">
         <string>ownCloud Path:</string>
        </property>
+       <property name="textFormat">
+        <enum>Qt::PlainText</enum>
+       </property>
       </widget>
      </item>
      <item row="0" column="0" rowspan="2">

+ 1 - 1
src/gui/sharelinkwidget.cpp

@@ -321,7 +321,7 @@ void ShareLinkWidget::redrawElidedUrl()
         const QUrl realUrl(_shareUrl);
         QString elidedUrl = fm.elidedText(_shareUrl, Qt::ElideRight, linkLengthPixel);
 
-        u = QString("<a href=\"%1\">%2</a>").arg(realUrl.toString(QUrl::None)).arg(elidedUrl);
+        u = QString("<a href=\"%1\">%2</a>").arg(Utility::escape(realUrl.toString(QUrl::None)), Utility::escape(elidedUrl));
     }
     _ui->_labelShareLink->setText(u);
 }

+ 3 - 0
src/gui/sharelinkwidget.ui

@@ -76,6 +76,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::PlainText</enum>
+     </property>
     </widget>
    </item>
    <item row="1" column="0" colspan="2">

+ 1 - 1
src/gui/sharemanager.cpp

@@ -345,7 +345,7 @@ QSharedPointer<LinkShare> ShareManager::parseLinkShare(const QVariantMap &data)
         url = QUrl(data.value("url").toString());
     } else if (_account->serverVersionInt() >= (8 << 16)) {
         // From ownCloud server version 8 on, a different share link scheme is used.
-        url = QUrl(Utility::concatUrlPath(_account->url(), QString("index.php/s/%1").arg(data.value("token").toString())).toString());
+        url = QUrl(Utility::concatUrlPath(_account->url(), QLatin1String("index.php/s/") + data.value("token").toString())).toString();
     } else {
         QList<QPair<QString, QString>> queryArgs;
         queryArgs.append(qMakePair(QString("service"), QString("files")));

+ 3 - 0
src/gui/shareusergroupwidget.ui

@@ -67,6 +67,9 @@
      <property name="text">
       <string notr="true">Placeholder for Error text</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::PlainText</enum>
+     </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>

+ 3 - 0
src/gui/sharewidget.ui

@@ -36,6 +36,9 @@
        <property name="text">
         <string>TextLabel</string>
        </property>
+       <property name="textFormat">
+        <enum>Qt::PlainText</enum>
+       </property>
       </widget>
      </item>
      <item>

+ 5 - 1
src/gui/sslbutton.cpp

@@ -58,7 +58,9 @@ static QString addCertDetailsField(const QString &key, const QString &value)
     if (value.isEmpty())
         return QString();
 
-    return QString::fromLatin1("<tr><td style=\"vertical-align: top;\"><b>%1</b></td><td style=\"vertical-align: bottom;\">%2</td></tr>").arg(key).arg(value);
+    return QLatin1String("<tr><td style=\"vertical-align: top;\"><b>") + key
+        + QLatin1String("</b></td><td style=\"vertical-align: bottom;\">)") + value
+        + QLatin1String("</td></tr>");
 }
 
 
@@ -162,7 +164,9 @@ QMenu* SslButton::buildCertMenu(QMenu *parent, const QSslCertificate& cert,
     // create label first
     QLabel *label = new QLabel(parent);
     label->setStyleSheet(QLatin1String("QLabel { padding: 8px; background-color: #fff; }"));
+    label->setTextFormat(Qt::RichText);
     label->setText(details);
+
     // plug label into widget action
     QWidgetAction *action = new QWidgetAction(parent);
     action->setDefaultWidget(label);

+ 2 - 1
src/gui/updater/ocupdater.cpp

@@ -339,7 +339,8 @@ void NSISUpdater::showDialog(const UpdateInfo &info)
     QLabel *lbl = new QLabel;
     QString txt = tr("<p>A new version of the %1 Client is available.</p>"
                      "<p><b>%2</b> is available for download. The installed version is %3.</p>")
-            .arg(Theme::instance()->appNameGUI()).arg(info.versionString()).arg(clientVersion());
+                      .arg(Utility::escape(Theme::instance()->appNameGUI()),
+                           Utility::escape(info.versionString()), Utility::escape(clientVersion()));
 
     lbl->setText(txt);
     lbl->setTextFormat(Qt::RichText);

+ 4 - 4
src/gui/wizard/owncloudadvancedsetuppage.cpp

@@ -156,10 +156,10 @@ void OwncloudAdvancedSetupPage::updateStatus()
         if( _remoteFolder.isEmpty() || _remoteFolder == QLatin1String("/") ) {
             t = "";
         } else {
-            t = tr("%1 folder '%2' is synced to local folder '%3'")
-                .arg(Theme::instance()->appName()).arg(_remoteFolder)
-                .arg(QDir::toNativeSeparators(locFolder));
-              _ui.rSyncEverything->setText(tr("Sync the folder '%1'").arg(_remoteFolder));
+            t = Utility::escape(tr("%1 folder '%2' is synced to local folder '%3'")
+                                    .arg(Theme::instance()->appName(), _remoteFolder,
+                                         QDir::toNativeSeparators(locFolder)));
+            _ui.rSyncEverything->setText(tr("Sync the folder '%1'").arg(_remoteFolder));
         }
 
         const bool dirNotEmpty(QDir(locFolder).entryList(QDir::AllEntries | QDir::NoDotAndDotDot).count() > 0);

+ 15 - 0
src/gui/wizard/owncloudadvancedsetuppage.ui

@@ -31,6 +31,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
@@ -249,6 +252,9 @@
             <property name="text">
              <string>TextLabel</string>
             </property>
+            <property name="textFormat">
+             <enum>Qt::PlainText</enum>
+            </property>
            </widget>
           </item>
           <item>
@@ -351,6 +357,9 @@
             <property name="text">
              <string>TextLabel</string>
             </property>
+            <property name="textFormat">
+             <enum>Qt::PlainText</enum>
+            </property>
            </widget>
           </item>
           <item>
@@ -385,6 +394,9 @@
      <property name="text">
       <string>Status message</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
@@ -401,6 +413,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
     </widget>
    </item>
   </layout>

+ 12 - 0
src/gui/wizard/owncloudhttpcredspage.ui

@@ -22,6 +22,9 @@
      <property name="text">
       <string notr="true">TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
@@ -89,6 +92,9 @@
        <property name="text">
         <string notr="true">Error Label</string>
        </property>
+       <property name="textFormat">
+        <enum>Qt::RichText</enum>
+       </property>
        <property name="openExternalLinks">
         <bool>true</bool>
        </property>
@@ -124,6 +130,9 @@
      <property name="text">
       <string notr="true">TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
     </widget>
    </item>
    <item row="1" column="1">
@@ -131,6 +140,9 @@
      <property name="text">
       <string notr="true">TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>

+ 9 - 0
src/gui/wizard/owncloudsetupnocredspage.ui

@@ -31,6 +31,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
@@ -156,6 +159,9 @@
      <property name="text">
       <string>Error Label</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
      <property name="openExternalLinks">
       <bool>true</bool>
      </property>
@@ -189,6 +195,9 @@
      <property name="text">
       <string>TextLabel</string>
      </property>
+     <property name="textFormat">
+      <enum>Qt::RichText</enum>
+     </property>
     </widget>
    </item>
   </layout>

+ 5 - 5
src/libsync/configfile.cpp

@@ -185,14 +185,14 @@ QVariant ConfigFile::getPolicySetting(const QString &setting, const QVariant& de
     if (Utility::isWindows()) {
         // check for policies first and return immediately if a value is found.
         QSettings userPolicy(QString::fromLatin1("HKEY_CURRENT_USER\\Software\\Policies\\%1\\%2")
-                             .arg(APPLICATION_VENDOR).arg(Theme::instance()->appName()),
+                             .arg(APPLICATION_VENDOR, Theme::instance()->appName()),
                              QSettings::NativeFormat);
         if(userPolicy.contains(setting)) {
             return userPolicy.value(setting);
         }
 
         QSettings machinePolicy(QString::fromLatin1("HKEY_LOCAL_MACHINE\\Software\\Policies\\%1\\%2")
-                                .arg(APPLICATION_VENDOR).arg(APPLICATION_NAME),
+                                .arg(APPLICATION_VENDOR, APPLICATION_NAME),
                                 QSettings::NativeFormat);
         if(machinePolicy.contains(setting)) {
             return machinePolicy.value(setting);
@@ -257,7 +257,7 @@ QString ConfigFile::excludeFileFromSystem()
     fi.setFile( QCoreApplication::applicationDirPath(), exclFile );
 #endif
 #ifdef Q_OS_UNIX
-    fi.setFile( QString( SYSCONFDIR "/%1").arg(Theme::instance()->appName()), exclFile );
+    fi.setFile(QString(SYSCONFDIR "/" + Theme::instance()->appName()), exclFile);
     if ( ! fi.exists() ) {
         // Prefer to return the preferred path! Only use the fallback location
         // if the other path does not exist and the fallback is valid.
@@ -489,8 +489,8 @@ QVariant ConfigFile::getValue(const QString& param, const QString& group,
         systemSetting = systemSettings.value(param, defaultValue);
     } else { // Windows
         QSettings systemSettings(QString::fromLatin1("HKEY_LOCAL_MACHINE\\Software\\%1\\%2")
-                                .arg(APPLICATION_VENDOR).arg(Theme::instance()->appName()),
-                                QSettings::NativeFormat);
+                                     .arg(APPLICATION_VENDOR, Theme::instance()->appName()),
+                                 QSettings::NativeFormat);
         if (!group.isEmpty()) {
             systemSettings.beginGroup(group);
         }

+ 4 - 3
src/libsync/owncloudtheme.cpp

@@ -27,6 +27,7 @@
 
 #include "version.h"
 #include "config.h"
+#include "utility.h"
 
 namespace OCC {
 
@@ -53,9 +54,9 @@ QString ownCloudTheme::about() const
                "ownCloud and the ownCloud Logo are registered trademarks of ownCloud GmbH "
                "in the United States, other countries, or both.</p>"
                )
-            .arg(MIRALL_VERSION_STRING)
-            .arg("https://" MIRALL_STRINGIFY(APPLICATION_DOMAIN))
-            .arg(MIRALL_STRINGIFY(APPLICATION_DOMAIN));
+            .arg(Utility::escape(MIRALL_VERSION_STRING),
+                 Utility::escape("https://" MIRALL_STRINGIFY(APPLICATION_DOMAIN)),
+                 Utility::escape(MIRALL_STRINGIFY(APPLICATION_DOMAIN)));
 
     devString += gitSHA1();
     return devString;

+ 1 - 2
src/libsync/utility.cpp

@@ -180,8 +180,7 @@ static QLatin1String platform()
 QByteArray Utility::userAgentString()
 {
     QString re = QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
-            .arg(platform())
-            .arg(QLatin1String(MIRALL_VERSION_STRING));
+                     .arg(platform(), QLatin1String(MIRALL_VERSION_STRING));
 
     QLatin1String appName(APPLICATION_SHORTNAME);