Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit e30d7acda6c04b667618ac86f49786cf966a08fb
- Author: Mikkel Krautz <mikkel@krautz.dk>
- Date: Tue May 13 20:54:27 2014 +0200
- mumble: fix Mumble-SA-2014-006.
- Usernames and channel names were not properly HTML-escaped
- when used in Qt widgets that are rich-text enabled.
- This commit fixes that, but also touches various other
- similar cases where an escaped version is appropriate.
- This commit is based on the following commits from the
- master branch (Mumble 1.3.0):
- b7d9387bd6dacbad0b2345f03dd8502a51c42f6a
- 1caaec763b91c8a12b11d7ceb37e21622f4da76e
- a0ebded7df388ce625dfbeb0c2bd65fb782da2a4
- c52dedce8409da0654fd197690ff95411df3f9b2
- 1f6ddaf35f9583ef72f2d924b76b425ec85fc692
- 73a1a98d16a29c78d85e1c19b8feac7ba22dddfe
- d58990c374502cfdd4a5f2bd8dbd490f19e9e511
- b6e17cac696396d5bcbc3391846f9cacb9c072c4
- 9837c4dc2d1d6c60505f7246cd00ffa33ad808a9
- 17fa695b222a8b308438f9283e78dfba931e8712
- d9ff1e947d4d00f6cd8d38fd04cd87f6e3167028
- Special thanks to Tim Cooper for various of the above
- patches.
- Rediffed by daviddavid (Mageia Team) for mumble-1.2.3.
- --- mumble-1.2.3/src/mumble/ALSAAudio.cpp.orig 2014-05-16 20:59:15.025347292 +0200
- +++ mumble-1.2.3/src/mumble/ALSAAudio.cpp 2014-05-16 21:01:08.715796764 +0200
- @@ -357,7 +357,7 @@
- snd_pcm_close(capture_handle);
- capture_handle = NULL;
- }
- - g.mw->msgBox(tr("Opening chosen ALSA Input failed: %1").arg(QLatin1String(snd_strerror(err))));
- + g.mw->msgBox(tr("Opening chosen ALSA Input failed: %1").arg(Qt::escape(QLatin1String(snd_strerror(err)))));
- return;
- }
- @@ -492,7 +492,7 @@
- snd_pcm_writei(pcm_handle, zerobuff, period_size);
- if (! bOk) {
- - g.mw->msgBox(tr("Opening chosen ALSA Output failed: %1").arg(QLatin1String(snd_strerror(err))));
- + g.mw->msgBox(tr("Opening chosen ALSA Output failed: %1").arg(Qt::escape(QLatin1String(snd_strerror(err)))));
- if (pcm_handle) {
- snd_pcm_close(pcm_handle);
- pcm_handle = NULL;
- --- mumble-1.2.3/src/mumble/ASIOInput.cpp.orig 2011-02-19 22:35:16.000000000 +0100
- +++ mumble-1.2.3/src/mumble/ASIOInput.cpp 2014-05-16 21:04:32.153652669 +0200
- @@ -265,7 +265,7 @@
- char err[255];
- iasio->getErrorMessage(err);
- SleepEx(10, false);
- - QMessageBox::critical(this, QLatin1String("Mumble"), tr("ASIO Initialization failed: %1").arg(QLatin1String(err)), QMessageBox::Ok, QMessageBox::NoButton);
- + QMessageBox::critical(this, QLatin1String("Mumble"), tr("ASIO Initialization failed: %1").arg(Qt::escape(QLatin1String(err))), QMessageBox::Ok, QMessageBox::NoButton);
- }
- iasio->Release();
- } else {
- @@ -290,7 +290,7 @@
- char err[255];
- iasio->getErrorMessage(err);
- SleepEx(10, false);
- - QMessageBox::critical(this, QLatin1String("Mumble"), tr("ASIO Initialization failed: %1").arg(QLatin1String(err)), QMessageBox::Ok, QMessageBox::NoButton);
- + QMessageBox::critical(this, QLatin1String("Mumble"), tr("ASIO Initialization failed: %1").arg(Qt::escape(QLatin1String(err))), QMessageBox::Ok, QMessageBox::NoButton);
- }
- iasio->Release();
- } else {
- --- mumble-1.2.3/src/mumble/ASIOInput.ui.orig 2014-05-16 21:08:49.101309395 +0200
- +++ mumble-1.2.3/src/mumble/ASIOInput.ui 2014-05-16 21:10:46.486228414 +0200
- @@ -99,6 +99,9 @@
- <property name="text">
- <string/>
- </property>
- + <property name="textFormat">
- + <enum>Qt::PlainText</enum>
- + </property>
- </widget>
- </item>
- <item row="1" column="0">
- @@ -119,6 +122,9 @@
- <property name="text">
- <string/>
- </property>
- + <property name="textFormat">
- + <enum>Qt::PlainText</enum>
- + </property>
- </widget>
- </item>
- </layout>
- --- mumble-1.2.3/src/mumble/AudioConfigDialog.cpp.orig 2011-02-19 22:35:16.000000000 +0100
- +++ mumble-1.2.3/src/mumble/AudioConfigDialog.cpp 2014-05-16 21:13:36.431827626 +0200
- @@ -350,7 +350,7 @@
- foreach(audioDevice d, ql) {
- qcbDevice->addItem(d.first, d.second);
- - qcbDevice->setItemData(idx, d.first, Qt::ToolTipRole);
- + qcbDevice->setItemData(idx, Qt::escape(d.first), Qt::ToolTipRole);
- ++idx;
- }
- @@ -483,7 +483,7 @@
- foreach(audioDevice d, ql) {
- qcbDevice->addItem(d.first, d.second);
- - qcbDevice->setItemData(idx, d.first, Qt::ToolTipRole);
- + qcbDevice->setItemData(idx, Qt::escape(d.first), Qt::ToolTipRole);
- ++idx;
- }
- bool canmute = aor->canMuteOthers();
- --- mumble-1.2.3/src/mumble/AudioOutput.cpp.orig 2014-05-16 21:22:15.179757821 +0200
- +++ mumble-1.2.3/src/mumble/AudioOutput.cpp 2014-05-16 21:23:08.124486823 +0200
- @@ -299,7 +299,7 @@
- if ((sf = AudioOutputSample::loadSndfile(file)) == NULL) {
- QMessageBox::critical(NULL,
- tr("Invalid sound file"),
- - tr("The file '%1' cannot be used by Mumble. Please select a file with a compatible format and encoding.").arg(file));
- + tr("The file '%1' cannot be used by Mumble. Please select a file with a compatible format and encoding.").arg(Qt::escape(file)));
- return QString();
- }
- delete sf;
- --- mumble-1.2.3/src/mumble/Cert.cpp.orig 2014-05-16 21:24:29.461824381 +0200
- +++ mumble-1.2.3/src/mumble/Cert.cpp 2014-05-16 21:27:26.031265449 +0200
- @@ -51,6 +51,7 @@
- grid->addWidget(l, 0, 0, 1, 1, Qt::AlignRight);
- qlSubjectName = new QLabel();
- + qlSubjectName->setTextFormat(Qt::PlainText);
- qlSubjectName->setWordWrap(true);
- grid->addWidget(qlSubjectName, 0, 1, 1, 1);
- @@ -58,6 +59,7 @@
- grid->addWidget(l, 1, 0, 1, 1, Qt::AlignRight);
- qlSubjectEmail = new QLabel();
- + qlSubjectEmail->setTextFormat(Qt::PlainText);
- qlSubjectEmail->setWordWrap(true);
- grid->addWidget(qlSubjectEmail, 1, 1, 1, 1);
- @@ -65,6 +67,7 @@
- grid->addWidget(l, 2, 0, 1, 1, Qt::AlignRight);
- qlIssuerName = new QLabel();
- + qlIssuerName->setTextFormat(Qt::PlainText);
- qlIssuerName->setWordWrap(true);
- grid->addWidget(qlIssuerName, 2, 1, 1, 1);
- @@ -100,12 +103,12 @@
- qlSubjectName->setText(tmpName);
- if (emails.count() > 0)
- - qlSubjectEmail->setText(emails.join(QLatin1String("<br />")));
- + qlSubjectEmail->setText(emails.join(QLatin1String("\n")));
- else
- qlSubjectEmail->setText(tr("(none)"));
- if (qscCert.expiryDate() <= QDateTime::currentDateTime())
- - qlExpiry->setText(QString::fromLatin1("<font color=\"red\"><b>%1</b></font>").arg(qscCert.expiryDate().toString(Qt::SystemLocaleDate)));
- + qlExpiry->setText(QString::fromLatin1("<font color=\"red\"><b>%1</b></font>").arg(Qt::escape(qscCert.expiryDate().toString(Qt::SystemLocaleDate))));
- else
- qlExpiry->setText(qscCert.expiryDate().toString(Qt::SystemLocaleDate));
- --- mumble-1.2.3/src/mumble/ConnectDialog.cpp.orig 2014-05-16 21:30:16.767965205 +0200
- +++ mumble-1.2.3/src/mumble/ConnectDialog.cpp 2014-05-16 21:33:57.459013903 +0200
- @@ -447,7 +447,7 @@
- } else if (role == Qt::ToolTipRole) {
- QStringList qsl;
- foreach(const QHostAddress &qha, qlAddresses)
- - qsl << qha.toString();
- + qsl << Qt::escape(qha.toString());
- double ploss = 100.0;
- @@ -457,18 +457,18 @@
- QString qs;
- qs +=
- QLatin1String("<table>") +
- - QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Servername"), qsName) +
- - QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Hostname"), qsHostname);
- + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Servername"), Qt::escape(qsName)) +
- + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Hostname"), Qt::escape(qsHostname));
- if (! qsBonjourHost.isEmpty())
- - qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Bonjour name"), qsBonjourHost);
- + qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Bonjour name"), Qt::escape(qsBonjourHost));
- qs +=
- QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Port")).arg(usPort) +
- QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Addresses"), qsl.join(QLatin1String(", ")));
- if (! qsUrl.isEmpty())
- - qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Website"), qsUrl);
- + qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Website"), Qt::escape(qsUrl));
- if (uiSent > 0) {
- qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Packet loss"), QString::fromLatin1("%1% (%2/%3)").arg(ploss, 0, 'f', 1).arg(uiRecv).arg(uiSent));
- @@ -622,7 +622,7 @@
- mime->setUrls(urls);
- mime->setText(qs);
- - mime->setHtml(QString::fromLatin1("<a href=\"%1\">%2</a>").arg(qs).arg(qsName));
- + mime->setHtml(QString::fromLatin1("<a href=\"%1\">%2</a>").arg(qs).arg(Qt::escape(name)));
- if (itType == FavoriteType)
- mime->setData(QLatin1String("OriginatedInMumble"), QByteArray());
- --- mumble-1.2.3/src/mumble/Database.cpp.orig 2014-05-16 21:35:46.167830234 +0200
- +++ mumble-1.2.3/src/mumble/Database.cpp 2014-05-16 21:36:38.653500893 +0200
- @@ -88,7 +88,7 @@
- QFileInfo fi(db.databaseName());
- if (! fi.isWritable()) {
- - QMessageBox::critical(NULL, QLatin1String("Mumble"), tr("The database '%1' is read-only. Mumble cannot store server settings (i.e. SSL certificates) until you fix this problem.").arg(fi.filePath()), QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
- + QMessageBox::critical(NULL, QLatin1String("Mumble"), tr("The database '%1' is read-only. Mumble cannot store server settings (i.e. SSL certificates) until you fix this problem.").arg(Qt::escape(fi.filePath())), QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
- qWarning("Database: Database is read-only");
- }
- --- mumble-1.2.3/src/mumble/LCD.cpp.orig 2014-05-16 21:38:09.227012321 +0200
- +++ mumble-1.2.3/src/mumble/LCD.cpp 2014-05-16 21:39:03.958968471 +0200
- @@ -108,7 +108,7 @@
- qtwi->setFlags(Qt::ItemIsEnabled |Qt::ItemIsUserCheckable);
- qtwi->setText(0, d->name());
- - qtwi->setToolTip(0, d->name());
- + qtwi->setToolTip(0, Qt::escape(d->name()));
- QSize lcdsize = d->size();
- QString qsSize = QString::fromLatin1("%1x%2").arg(lcdsize.width()).arg(lcdsize.height());
- --- mumble-1.2.3/src/mumble/Log.cpp.orig 2014-05-16 20:01:17.293295057 +0200
- +++ mumble-1.2.3/src/mumble/Log.cpp 2014-05-16 21:44:30.732499706 +0200
- @@ -270,7 +270,7 @@
- }
- QString Log::formatChannel(::Channel *c) {
- - return QString::fromLatin1("<a href='channelid://%1/%3' class='log-channel'>%2</a>").arg(c->iId).arg(c->qsName).arg(QString::fromLatin1(g.sh->qbaDigest.toBase64()));
- + return QString::fromLatin1("<a href='channelid://%1/%3' class='log-channel'>%2</a>").arg(c->iId).arg(Qt::escape(c->qsName)).arg(QString::fromLatin1(g.sh->qbaDigest.toBase64()));
- }
- QString Log::formatClientUser(ClientUser *cu, LogColorType t) {
- @@ -282,10 +282,11 @@
- }
- if (cu) {
- + QString name = Qt::escape(cu->qsName);
- if (cu->qsHash.isEmpty()) {
- - return QString::fromLatin1("<a href='clientid://%2/%4' class='log-user log-%1'>%3</a>").arg(className).arg(cu->uiSession).arg(cu->qsName).arg(QString::fromLatin1(g.sh->qbaDigest.toBase64()));
- + return QString::fromLatin1("<a href='clientid://%2/%4' class='log-user log-%1'>%3</a>").arg(className).arg(cu->uiSession).arg(name).arg(QString::fromLatin1(g.sh->qbaDigest.toBase64()));
- } else {
- - return QString::fromLatin1("<a href='clientid://%2' class='log-user log-%1'>%3</a>").arg(className).arg(cu->qsHash).arg(cu->qsName);
- + return QString::fromLatin1("<a href='clientid://%2' class='log-user log-%1'>%3</a>").arg(className).arg(cu->qsHash).arg(name);
- }
- } else {
- return QString::fromLatin1("<span class='log-server log-%1'>%2</span>").arg(className).arg(tr("the server"));
- @@ -447,7 +448,7 @@
- if (qdDate != dt.date()) {
- qdDate = dt.date();
- tc.insertBlock();
- - tc.insertHtml(tr("[Date changed to %1]\n").arg(qdDate.toString(Qt::DefaultLocaleShortDate)));
- + tc.insertHtml(tr("[Date changed to %1]\n").arg(Qt::escape(qdDate.toString(Qt::DefaultLocaleShortDate))));
- tc.movePosition(QTextCursor::End);
- }
- @@ -460,7 +461,7 @@
- } else if (! g.mw->qteLog->document()->isEmpty()) {
- tc.insertBlock();
- }
- - tc.insertHtml(Log::msgColor(QString::fromLatin1("[%1] ").arg(dt.time().toString(Qt::DefaultLocaleShortDate)), Log::Time));
- + tc.insertHtml(Log::msgColor(QString::fromLatin1("[%1] ").arg(Qt::escape(dt.time().toString(Qt::DefaultLocaleShortDate))), Log::Time));
- validHtml(console, true, &tc);
- tc.movePosition(QTextCursor::End);
- g.mw->qteLog->setTextCursor(tc);
- --- mumble-1.2.3/src/mumble/MainWindow.cpp.orig 2014-05-16 20:28:57.462753125 +0200
- +++ mumble-1.2.3/src/mumble/MainWindow.cpp 2014-05-16 21:54:41.068070219 +0200
- @@ -638,7 +638,7 @@
- }
- void MainWindow::openUrl(const QUrl &url) {
- - g.l->log(Log::Information, tr("Opening URL %1").arg(url.toString()));
- + g.l->log(Log::Information, tr("Opening URL %1").arg(Qt::escape(url.toString())));
- if (url.scheme() == QLatin1String("file")) {
- QFile f(url.toLocalFile());
- if (! f.exists() || ! f.open(QIODevice::ReadOnly)) {
- @@ -726,7 +726,7 @@
- g.s.qsLastServer = name;
- rtLast = MumbleProto::Reject_RejectType_None;
- qaServerDisconnect->setEnabled(true);
- - g.l->log(Log::Information, tr("Connecting to server %1.").arg(Log::msgColor(host, Log::Server)));
- + g.l->log(Log::Information, tr("Connecting to server %1.").arg(Log::msgColor(Qt::escape(host), Log::Server)));
- g.sh->setConnectionInfo(host, port, user, pw);
- g.sh->start(QThread::TimeCriticalPriority);
- }
- @@ -902,7 +902,7 @@
- qsDesiredChannel = QString();
- rtLast = MumbleProto::Reject_RejectType_None;
- qaServerDisconnect->setEnabled(true);
- - g.l->log(Log::Information, tr("Connecting to server %1.").arg(Log::msgColor(cd->qsServer, Log::Server)));
- + g.l->log(Log::Information, tr("Connecting to server %1.").arg(Log::msgColor(Qt::escape(cd->qsServer), Log::Server)));
- g.sh->setConnectionInfo(cd->qsServer, cd->usPort, cd->qsUsername, cd->qsPassword);
- g.sh->start(QThread::TimeCriticalPriority);
- }
- @@ -978,7 +978,7 @@
- return;
- QMessageBox::StandardButton result;
- - result = QMessageBox::question(this, tr("Register yourself as %1").arg(p->qsName), tr("<p>You are about to register yourself on this server. This action cannot be undone, and your username cannot be changed once this is done. You will forever be known as '%1' on this server.</p><p>Are you sure you want to register yourself?</p>").arg(p->qsName), QMessageBox::Yes|QMessageBox::No);
- + result = QMessageBox::question(this, tr("Register yourself as %1").arg(p->qsName), tr("<p>You are about to register yourself on this server. This action cannot be undone, and your username cannot be changed once this is done. You will forever be known as '%1' on this server.</p><p>Are you sure you want to register yourself?</p>").arg(Qt::escape(p->qsName)), QMessageBox::Yes|QMessageBox::No);
- if (result == QMessageBox::Yes)
- g.sh->registerUser(p->uiSession);
- @@ -1052,7 +1052,7 @@
- qsVersion.append(tr("<p>No build information or OS version available.</p>"));
- } else {
- qsVersion.append(tr("<p>%1 (%2)<br />%3</p>")
- - .arg(g.sh->qsRelease, g.sh->qsOS, g.sh->qsOSVersion));
- + .arg(Qt::escape(g.sh->qsRelease), Qt::escape(g.sh->qsOS), Qt::escape(g.sh->qsOSVersion)));
- }
- QString host, uname, pw;
- @@ -1061,10 +1061,10 @@
- g.sh->getConnectionInfo(host,port,uname,pw);
- QString qsControl=tr("<h2>Control channel</h2><p>Encrypted with %1 bit %2<br />%3 ms average latency (%4 deviation)</p><p>Remote host %5 (port %6)</p>").arg(QString::number(qsc.usedBits()),
- - qsc.name(),
- + Qt::escape(qsc.name()),
- QString::fromLatin1("%1").arg(boost::accumulators::mean(g.sh->accTCP), 0, 'f', 2),
- QString::fromLatin1("%1").arg(sqrt(boost::accumulators::variance(g.sh->accTCP)),0,'f',2),
- - host,
- + Qt::escape(host),
- QString::number(port));
- QString qsVoice, qsCrypt, qsAudio;
- @@ -1305,9 +1305,9 @@
- QMessageBox::StandardButton result;
- if (session == g.uiSession)
- - result = QMessageBox::question(this, tr("Register yourself as %1").arg(p->qsName), tr("<p>You are about to register yourself on this server. This action cannot be undone, and your username cannot be changed once this is done. You will forever be known as '%1' on this server.</p><p>Are you sure you want to register yourself?</p>").arg(p->qsName), QMessageBox::Yes|QMessageBox::No);
- + result = QMessageBox::question(this, tr("Register yourself as %1").arg(p->qsName), tr("<p>You are about to register yourself on this server. This action cannot be undone, and your username cannot be changed once this is done. You will forever be known as '%1' on this server.</p><p>Are you sure you want to register yourself?</p>").arg(Qt::escape(p->qsName)), QMessageBox::Yes|QMessageBox::No);
- else
- - result = QMessageBox::question(this, tr("Register user %1").arg(p->qsName), tr("<p>You are about to register %1 on the server. This action cannot be undone, the username cannot be changed, and as a registered user, %1 will have access to the server even if you change the server password.</p><p>From this point on, %1 will be authenticated with the certificate currently in use.</p><p>Are you sure you want to register %1?</p>").arg(p->qsName), QMessageBox::Yes|QMessageBox::No);
- + result = QMessageBox::question(this, tr("Register user %1").arg(p->qsName), tr("<p>You are about to register %1 on the server. This action cannot be undone, the username cannot be changed, and as a registered user, %1 will have access to the server even if you change the server password.</p><p>From this point on, %1 will be authenticated with the certificate currently in use.</p><p>Are you sure you want to register %1?</p>").arg(Qt::escape(p->qsName)), QMessageBox::Yes|QMessageBox::No);
- if (result == QMessageBox::Yes) {
- p = ClientUser::get(session);
- @@ -1445,7 +1445,7 @@
- unsigned int session = p->uiSession;
- int ret = QMessageBox::question(this, QLatin1String("Mumble"),
- - tr("Are you sure you want to reset the comment of user %1?").arg(p->qsName),
- + tr("Are you sure you want to reset the comment of user %1?").arg(Qt::escape(p->qsName)),
- QMessageBox::Yes, QMessageBox::No);
- if (ret == QMessageBox::Yes) {
- g.sh->setUserComment(session, QString());
- @@ -1638,7 +1638,7 @@
- int id = c->iId;
- - ret=QMessageBox::question(this, QLatin1String("Mumble"), tr("Are you sure you want to delete %1 and all its sub-channels?").arg(c->qsName), QMessageBox::Yes, QMessageBox::No);
- + ret=QMessageBox::question(this, QLatin1String("Mumble"), tr("Are you sure you want to delete %1 and all its sub-channels?").arg(Qt::escape(c->qsName)), QMessageBox::Yes, QMessageBox::No);
- c = Channel::get(id);
- if (!c)
- @@ -2331,7 +2331,7 @@
- if (! g.sh->qlErrors.isEmpty()) {
- foreach(QSslError e, g.sh->qlErrors)
- - g.l->log(Log::Warning, tr("SSL Verification failed: %1").arg(e.errorString()));
- + g.l->log(Log::Warning, tr("SSL Verification failed: %1").arg(Qt::escape(e.errorString())));
- if (! g.sh->qscCert.isEmpty()) {
- QSslCertificate c = g.sh->qscCert.at(0);
- QString basereason;
- @@ -2342,7 +2342,7 @@
- }
- QStringList qsl;
- foreach(QSslError e, g.sh->qlErrors)
- - qsl << QString::fromLatin1("<li>%1</li>").arg(e.errorString());
- + qsl << QString::fromLatin1("<li>%1</li>").arg(Qt::escape(e.errorString()));
- QMessageBox qmb(QMessageBox::Warning, QLatin1String("Mumble"),
- tr("<p>%1.<br />The specific errors with this certificate are: </p><ol>%2</ol>"
- @@ -2402,7 +2402,7 @@
- bool matched = false;
- if (! reason.isEmpty()) {
- - g.l->log(Log::ServerDisconnected, tr("Server connection failed: %1.").arg(reason));
- + g.l->log(Log::ServerDisconnected, tr("Server connection failed: %1.").arg(Qt::escape(reason)));
- } else {
- g.l->log(Log::ServerDisconnected, tr("Disconnected from server."));
- }
- @@ -2522,10 +2522,10 @@
- if (c == NULL) // If no channel selected fallback to current one
- c = ClientUser::get(g.uiSession)->cChannel;
- - qteChat->setDefaultText(tr("<center>Type message to channel '%1' here</center>").arg(c->qsName));
- + qteChat->setDefaultText(tr("<center>Type message to channel '%1' here</center>").arg(Qt::escape(c->qsName)));
- } else {
- // User target
- - qteChat->setDefaultText(tr("<center>Type message to user '%1' here</center>").arg(p->qsName));
- + qteChat->setDefaultText(tr("<center>Type message to user '%1' here</center>").arg(Qt::escape(p->qsName)));
- }
- updateMenuPermissions();
- --- mumble-1.2.3/src/mumble/Messages.cpp.orig 2014-05-16 21:56:41.041318202 +0200
- +++ mumble-1.2.3/src/mumble/Messages.cpp 2014-05-16 22:06:19.729866541 +0200
- @@ -85,7 +85,7 @@
- void MainWindow::msgReject(const MumbleProto::Reject &msg) {
- rtLast = msg.type();
- - g.l->log(Log::ServerDisconnected, tr("Server connection rejected: %1.").arg(u8(msg.reason())));
- + g.l->log(Log::ServerDisconnected, tr("Server connection rejected: %1.").arg(Qt::escape(u8(msg.reason()))));
- g.l->setIgnore(Log::ServerDisconnected, 1);
- }
- @@ -126,7 +126,7 @@
- ClientUser *p=ClientUser::get(g.uiSession);
- connect(p, SIGNAL(talkingChanged()), this, SLOT(talkingChanged()));
- - qstiIcon->setToolTip(tr("Mumble: %1").arg(Channel::get(0)->qsName));
- + qstiIcon->setToolTip(tr("Mumble: %1").arg(Qt::escape(Channel::get(0)->qsName)));
- // Update QActions and menues
- on_qmServer_aboutToShow();
- @@ -190,7 +190,7 @@
- g.s.bTTS = true;
- quint32 oflags = g.s.qmMessages.value(Log::PermissionDenied);
- g.s.qmMessages[Log::PermissionDenied] = (oflags | Settings::LogTTS) & (~Settings::LogSoundfile);
- - g.l->log(Log::PermissionDenied, QString::fromAscii(g.ccHappyEaster + 39).arg(u));
- + g.l->log(Log::PermissionDenied, QString::fromAscii(g.ccHappyEaster + 39).arg(Qt::escape(u)));
- g.s.qmMessages[Log::PermissionDenied] = oflags;
- g.s.bDeaf = bold;
- g.s.bTTS = bold2;
- @@ -215,7 +215,7 @@
- break;
- case MumbleProto::PermissionDenied_DenyType_UserName: {
- if (msg.has_name())
- - g.l->log(Log::PermissionDenied, tr("Invalid username: %1.").arg(u8(msg.name())));
- + g.l->log(Log::PermissionDenied, tr("Invalid username: %1.").arg(Qt::escape(u8(msg.name()))));
- else
- g.l->log(Log::PermissionDenied, tr("Invalid username."));
- }
- @@ -226,7 +226,7 @@
- break;
- default: {
- if (msg.has_reason())
- - g.l->log(Log::PermissionDenied, tr("Denied: %1.").arg(u8(msg.reason())));
- + g.l->log(Log::PermissionDenied, tr("Denied: %1.").arg(Qt::escape(u8(msg.reason()))));
- else
- g.l->log(Log::PermissionDenied, tr("Permission denied."));
- }
- @@ -469,7 +469,7 @@
- ACTOR_INIT;
- SELF_INIT;
- - QString reason = u8(msg.reason());
- + QString reason = Qt::escape(u8(msg.reason()));
- if (pDst == pSelf) {
- if (msg.ban())
- --- mumble-1.2.3/src/mumble/Overlay.cpp.orig 2014-05-16 20:33:30.234704214 +0200
- +++ mumble-1.2.3/src/mumble/Overlay.cpp 2014-05-16 22:10:06.142642440 +0200
- @@ -97,7 +97,7 @@
- #endif
- if (! qlsServer->listen(pipepath)) {
- - QMessageBox::warning(NULL, QLatin1String("Mumble"), tr("Failed to create communication with overlay at %2: %1. No overlay will be available.").arg(qlsServer->errorString(),pipepath), QMessageBox::Ok, QMessageBox::NoButton);
- + QMessageBox::warning(NULL, QLatin1String("Mumble"), tr("Failed to create communication with overlay at %2: %1. No overlay will be available.").arg(Qt::escape(qlsServer->errorString()), Qt::escape(pipepath)), QMessageBox::Ok, QMessageBox::NoButton);
- } else {
- qWarning() << "Overlay: Listening on" << qlsServer->fullServerName();
- connect(qlsServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
- --- mumble-1.2.3/src/mumble/Plugins.cpp.orig 2014-05-16 22:11:26.490854285 +0200
- +++ mumble-1.2.3/src/mumble/Plugins.cpp 2014-05-16 22:14:38.520260235 +0200
- @@ -162,7 +162,7 @@
- i->setCheckState(1, pi->enabled ? Qt::Checked : Qt::Unchecked);
- i->setText(0, pi->description);
- if (pi->p->longdesc)
- - i->setToolTip(0, QString::fromStdWString(pi->p->longdesc()));
- + i->setToolTip(0, Qt::escape(QString::fromStdWString(pi->p->longdesc())));
- i->setData(0, Qt::UserRole, pi->filename);
- }
- qtwPlugins->setCurrentItem(qtwPlugins->topLevelItem(0));
- @@ -372,7 +372,7 @@
- QReadLocker lock(&qrwlPlugins);
- if (prevlocked) {
- - g.l->log(Log::Information, tr("%1 lost link.").arg(prevlocked->shortname));
- + g.l->log(Log::Information, tr("%1 lost link.").arg(Qt::escape(prevlocked->shortname)));
- prevlocked = NULL;
- }
- @@ -446,7 +446,7 @@
- if (pi->enabled) {
- if (pi->p2 ? pi->p2->trylock(pids) : pi->p->trylock()) {
- pi->shortname = QString::fromStdWString(pi->p->shortname);
- - g.l->log(Log::Information, tr("%1 linked.").arg(pi->shortname));
- + g.l->log(Log::Information, tr("%1 linked.").arg(Qt::escape(pi->shortname)));
- pi->locked = true;
- bUnlink = false;
- locked = pi;
- @@ -629,15 +629,15 @@
- if (f.open(QIODevice::WriteOnly)) {
- f.write(qba);
- f.close();
- - g.mw->msgBox(tr("Downloaded new or updated plugin to %1.").arg(f.fileName()));
- + g.mw->msgBox(tr("Downloaded new or updated plugin to %1.").arg(Qt::escape(f.fileName())));
- } else {
- f.setFileName(qsUserPlugins + QLatin1String("/") + fname);
- if (f.open(QIODevice::WriteOnly)) {
- f.write(qba);
- f.close();
- - g.mw->msgBox(tr("Downloaded new or updated plugin to %1.").arg(f.fileName()));
- + g.mw->msgBox(tr("Downloaded new or updated plugin to %1.").arg(Qt::escape(f.fileName())));
- } else {
- - g.mw->msgBox(tr("Failed to install new plugin to %1.").arg(f.fileName()));
- + g.mw->msgBox(tr("Failed to install new plugin to %1.").arg(Qt::escape(f.fileName())));
- }
- }
- --- mumble-1.2.3/src/mumble/VersionCheck.cpp.orig 2014-05-16 22:15:52.736692762 +0200
- +++ mumble-1.2.3/src/mumble/VersionCheck.cpp 2014-05-16 22:17:45.609038256 +0200
- @@ -151,7 +151,7 @@
- }
- } else {
- fetch.setHost(g.qsRegionalHost);
- - g.mw->msgBox(tr("Downloading new snapshot from %1 to %2").arg(fetch.toString(), filename));
- + g.mw->msgBox(tr("Downloading new snapshot from %1 to %2").arg(Qt::escape(fetch.toString()), Qt::escape(filename)));
- QNetworkReply *nrep = Network::get(fetch);
- connect(nrep, SIGNAL(finished()), this, SLOT(finished()));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement