Skip to content

Commit

Permalink
Properly handled all known percent encoding cases and exclusions usin…
Browse files Browse the repository at this point in the history
…g QURL::toPercentEncoding().
  • Loading branch information
josephcrowell authored and jpnurmi committed Oct 20, 2013
1 parent 33d8fbb commit 40d1875
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/irctextformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "ircpalette.h"
#include <QStringList>
#include <QRegExp>
#include <QUrl>
#include "irc.h"

IRC_BEGIN_NAMESPACE
Expand Down Expand Up @@ -303,7 +304,7 @@ QString IrcTextFormat::toHtml(const QString& text) const
protocol = QLatin1String("http://");
}

QString link = QString(QLatin1String("<a href='%1%2'>%3</a>")).arg(protocol, href, href);
QString link = QString(QLatin1String("<a href='%1%2'>%3</a>")).arg(protocol, QUrl::toPercentEncoding(href, ":/@%"), href);
processed.replace(pos, len, link);
pos += link.length();
}
Expand Down

0 comments on commit 40d1875

Please sign in to comment.