Fix crash if topic has a CarriageReturn
authorromibi <romibi@bluewin.ch>
Thu, 16 Jun 2016 22:50:40 +0000 (00:50 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 6 Sep 2016 19:41:30 +0000 (21:41 +0200)
Resolves GH-218.

src/qtui/topicwidget.cpp

index f31838c..b449f12 100644 (file)
@@ -281,6 +281,9 @@ QString TopicWidget::sanitizeTopic(const QString& topic)
     // some unicode characters with a new line, which then triggers
     // a stack overflow later
     QString result(topic);
     // some unicode characters with a new line, which then triggers
     // a stack overflow later
     QString result(topic);
+#if QT_VERSION >= 0x050000
+    result.replace(QChar::CarriageReturn, " ");
+#endif
     result.replace(QChar::ParagraphSeparator, " ");
     result.replace(QChar::LineSeparator, " ");
 
     result.replace(QChar::ParagraphSeparator, " ");
     result.replace(QChar::LineSeparator, " ");