From 2c4595ad02ff35011c24ea71c193d5a9710bec30 Mon Sep 17 00:00:00 2001 From: Matthew Vogt Date: Tue, 19 Jun 2012 10:24:01 +1000 Subject: Decode directory separators in source URLs URLs with encoded directory-separator characters are not correctly processed by QUrl. Task-number: QTBUG-25981 Change-Id: I78173ef44c4850774b56753335bea34db04c0735 Reviewed-by: Chris Adams --- src/qml/qml/v4/qv4bindings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/qml/qml/v4') diff --git a/src/qml/qml/v4/qv4bindings.cpp b/src/qml/qml/v4/qv4bindings.cpp index ff16f3b95b..7d42b47d53 100644 --- a/src/qml/qml/v4/qv4bindings.cpp +++ b/src/qml/qml/v4/qv4bindings.cpp @@ -1296,7 +1296,9 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, if (src.isUndefined()) { output.setUndefined(); } else { - const QString tmp(*src.getstringptr()); + QString tmp(*src.getstringptr()); + // Encoded dir-separators defeat QUrl processing - decode them first + tmp.replace(QLatin1String("%2f"), QLatin1String("/"), Qt::CaseInsensitive); if (instr->unaryop.src == instr->unaryop.output) { output.cleanupString(); MARK_CLEAN_REGISTER(instr->unaryop.output); @@ -1326,7 +1328,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, COLOR_REGISTER(instr->unaryop.output); } } - QML_V4_END_INSTR(ConvertStringToUrl, unaryop) + QML_V4_END_INSTR(ConvertStringToColor, unaryop) QML_V4_BEGIN_INSTR(ConvertStringToVariant, unaryop) { -- cgit v1.2.3