1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

[PageFormCompleter] Don't try to extract form if formdata is invalid.

This commit is contained in:
nowrep 2013-02-25 14:51:52 +01:00
parent e7213bdf12
commit 0ca121898d
2 changed files with 7 additions and 7 deletions

View File

@ -18,13 +18,13 @@ win32-msvc* {
# Check for pkg-config availability # Check for pkg-config availability
system(pkg-config --version > /dev/null) { system(pkg-config --version > /dev/null) {
isEqual(QT_MAJOR_VERSION, 5) { isEqual(QT_MAJOR_VERSION, 5) {
MODNAME=Qt5WebKitWidgets MODNAME = Qt5WebKitWidgets
} }
else { else {
MODNAME=QtWebKit MODNAME = QtWebKit
} }
QTWEBKIT_VERSION = $$system(PKG_CONFIG_PATH=$$[QT_INSTALL_LIBS]/pkgconfig pkg-config --modversion $$MODNAME) QTWEBKIT_VERSION = $$system(PKG_CONFIG_PATH="$$[QT_INSTALL_LIBS]/pkgconfig" pkg-config --modversion $$MODNAME)
QTWEBKIT_VERSION_MAJOR = $$section(QTWEBKIT_VERSION, ".", 0, 0) QTWEBKIT_VERSION_MAJOR = $$section(QTWEBKIT_VERSION, ".", 0, 0)
QTWEBKIT_VERSION_MINOR = $$section(QTWEBKIT_VERSION, ".", 1, 1) QTWEBKIT_VERSION_MINOR = $$section(QTWEBKIT_VERSION, ".", 1, 1)

View File

@ -39,17 +39,17 @@ PageFormData PageFormCompleter::extractFormData(const QByteArray &postData) cons
QByteArray data = convertWebKitFormBoundaryIfNecessary(postData); QByteArray data = convertWebKitFormBoundaryIfNecessary(postData);
PageFormData formData = {false, QString(), QString(), data}; PageFormData formData = {false, QString(), QString(), data};
if (data.isEmpty()) { if (data.isEmpty() || !data.contains('=')) {
return formData; return formData;
} }
if (!data.contains('=')) { const QueryItems &queryItems = createQueryItems(data);
qDebug() << "PageFormCompleter: Invalid form data" << data;
if (queryItems.isEmpty()) {
return formData; return formData;
} }
const QWebElementCollection &allForms = getAllElementsFromPage(m_page, "form"); const QWebElementCollection &allForms = getAllElementsFromPage(m_page, "form");
const QueryItems &queryItems = createQueryItems(data);
// Find form that contains password value sent in data // Find form that contains password value sent in data
foreach(const QWebElement & formElement, allForms) { foreach(const QWebElement & formElement, allForms) {