Commit 32f16e26 authored by Andrea Iacovitti's avatar Andrea Iacovitti
Browse files

Fix setting url userinfo in xmlhttprequest.

BUG: 275033
FIXED-IN: 4.9.5
parent af93389d
......@@ -922,15 +922,18 @@ JSValue *XMLHttpRequestProtoFunc::callAsFunction(ExecState *exec, JSObject *this
bool async = true;
if (args.size() >= 3) {
async = args[2]->toBoolean(exec);
async = args[2]->toBoolean(exec);
}
if (args.size() >= 4) {
url.setUser(args[3]->toString(exec).qstring());
}
if (args.size() >= 5) {
url.setPass(args[4]->toString(exec).qstring());
// Set url userinfo
if (args.size() >= 4 && !args[3]->isUndefinedOrNull()) {
QString user = args[3]->toString(exec).qstring();
if (!user.isEmpty()) {
url.setUser(user);
if (args.size() >= 5 && !args[4]->isUndefinedOrNull()) {
url.setPass(args[4]->toString(exec).qstring());
}
}
}
request->open(method, url, async, ec);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment