Escaped the strings that are shown in the dialog and preserve some layout.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 10 Sep 2013 21:41:58 +0000 (21:41 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 10 Sep 2013 21:41:58 +0000 (21:41 +0000)
src/gui/eventdialog.cpp

index eb006ce..6b51733 100644 (file)
@@ -38,19 +38,21 @@ EventDialog::EventDialog(int conferenceId, int eventId, QWidget *parent): QDialo
 
     QString info;
     // title
-    info.append(QString("<h1>%1</h1>\n").arg(event.title()));
+    info.append(QString("<h1>%1</h1>\n").arg(Qt::escape(event.title())));
 
     // persons
     info += QString("<h2>%1</h2>\n").arg(tr("Persons"));
-    info += QString("<p>%1</p>\n").arg(event.persons().join(", "));
+    QStringList persons = event.persons();
+    for (int i = 0; i != persons.size(); ++i) persons[i] = Qt::escape(persons[i]);
+    info += QString("<p>%1</p>\n").arg(persons.join(", "));
 
     // abstract
     info += QString("<h2>%1</h2>\n").arg(tr("Abstract"));
-    info += QString("<p>%1</p>\n").arg(event.abstract());
+    info += Qt::convertFromPlainText(event.abstract(), Qt::WhiteSpaceNormal);
 
     // description
     info += QString("<h2>%1</h2>\n").arg(tr("Description"));
-    info += QString("<p>%1</p>\n").arg(event.description());
+    info += Qt::convertFromPlainText(event.description(), Qt::WhiteSpaceNormal);
 
     // links
     info += QString("<h2>%1</h2>\n<ul>\n").arg(tr("Links"));
@@ -61,7 +63,7 @@ EventDialog::EventDialog(int conferenceId, int eventId, QWidget *parent): QDialo
         QString name(i.key());
         if (url.isEmpty() || url == "http://") continue;
         if (name.isEmpty()) name = url;
-        info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(url, name);
+        info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(Qt::escape(url), Qt::escape(name));
     }
     info += QString("</ul>\n");
     eventInfoTextBrowser->setHtml(info);