1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Serializing strings from ssl certificates

This is only start, all strings from web pages are going to be
serialized until 1.0.0 stable

See http://labs.qt.nokia.com/2011/10/04/security-considerations-
This commit is contained in:
nowrep 2011-11-03 20:12:35 +01:00
parent 575b15db6c
commit a09778896c
4 changed files with 11 additions and 6 deletions

View File

@ -17,7 +17,6 @@
* ============================================================ */
#include "certificateinfowidget.h"
#include "ui_certificateinfowidget.h"
#include <QDebug>
QString CertificateInfoWidget::certificateItemText(const QSslCertificate &cert)
{
@ -32,10 +31,11 @@ QString CertificateInfoWidget::certificateItemText(const QSslCertificate &cert)
QString CertificateInfoWidget::clearCertSpecialSymbols(const QString &string)
{
if (!string.contains("\\"))
return string;
QString n = Qt::escape(string);
if (!n.contains("\\"))
return n;
QString n = string;
//Credits to http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/176679?help-en
n.replace("\\xC3\\x80", "A"); n.replace("\\xC3\\x81", "A"); n.replace("\\xC3\\x82", "A"); n.replace("\\xC3\\x83", "A");
n.replace("\\xC3\\x84", "A"); n.replace("\\xC3\\x85", "A"); n.replace("\\xC3\\x86", "AE"); n.replace("\\xC3\\x87", "C");

View File

@ -21,6 +21,7 @@
#include <QWidget>
#include <QSslCertificate>
#include <QDateTime>
#include <QTextDocument>
namespace Ui {
class CertificateInfoWidget;

View File

@ -284,11 +284,13 @@ int TabWidget::addView(QUrl url, const QString &title, OpenUrlIn openIn, bool se
void TabWidget::setTabText(int index, const QString& text)
{
QString newtext = text;
newtext.remove("&"); // Avoid Alt+? shortcuts
if (WebTab* webTab = qobject_cast<WebTab*>(p_QupZilla->tabWidget()->widget(index)) ) {
if (webTab->isPinned())
newtext = "";
}
QTabWidget::setTabText(index, newtext);
}

View File

@ -18,14 +18,16 @@
#ifndef TABWIDGET_H
#define TABWIDGET_H
#include "webview.h"
#include "webtab.h"
#include <QTabWidget>
#include <QTabBar>
#include <QDateTime>
#include <QToolButton>
#include <QStylePainter>
#include <QStackedWidget>
#include <QTextDocument>
#include "webview.h"
#include "webtab.h"
class QupZilla;
class WebView;