avm2: Fix two bugs that caused wrong query parameters with navigateToURL
This commit is contained in:
parent
5c1fcb9f26
commit
cdf587c5a5
|
@ -55,7 +55,7 @@ fn parse_data<'gc>(
|
|||
if data.is_of_type(activation, urlvariables) {
|
||||
let obj = data.coerce_to_object(activation)?;
|
||||
vars = object_to_index_map(activation, &obj).unwrap_or_default();
|
||||
} else {
|
||||
} else if *data != Value::Null {
|
||||
let str_data = data.coerce_to_string(activation)?.to_string();
|
||||
if !url.contains('?') {
|
||||
url.push('?');
|
||||
|
|
|
@ -138,7 +138,7 @@ impl<F: FutureSpawner, I: NavigatorInterface> NavigatorBackend for ExternalNavig
|
|||
};
|
||||
|
||||
let modified_url = match vars_method {
|
||||
Some((_, query_pairs)) => {
|
||||
Some((_, query_pairs)) if !query_pairs.is_empty() => {
|
||||
{
|
||||
//lifetime limiter because we don't have NLL yet
|
||||
let mut modifier = parsed_url.query_pairs_mut();
|
||||
|
@ -150,7 +150,7 @@ impl<F: FutureSpawner, I: NavigatorInterface> NavigatorBackend for ExternalNavig
|
|||
|
||||
parsed_url
|
||||
}
|
||||
None => parsed_url,
|
||||
_ => parsed_url,
|
||||
};
|
||||
|
||||
if modified_url.scheme() == "javascript" {
|
||||
|
|
Loading…
Reference in New Issue