Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/params2list.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
ASSERT(json_encode(params2list("a;a;a")) == @#{"a":["","",""]}#)

ASSERT(params2list("a=1;b=2") ~= list(a="1", b="2"))
ASSERT(params2list("a=1;a=2") ~= list(a="2"))
ASSERT(params2list("a=1;a=2")["a"] ~= list("1","2"))
8 changes: 5 additions & 3 deletions OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1886,9 +1886,11 @@ public static DreamList Params2List(DreamObjectTree objectTree, string queryStri
}
}
} else {
string queryValue = queryValues[^1]; //Use the last appearance of the key in the query

list.SetValue(new DreamValue(queryKey), new DreamValue(queryValue));
// NOTE: At some point BYOND's handling of duplicate keys changed from "use the last value" to "create a list of values for that key"
if (queryValues.Length > 1)
list.SetValue(new DreamValue(queryKey), new DreamValue(objectTree.CreateList(queryValues)));
else
list.SetValue(new DreamValue(queryKey), new DreamValue(queryValues[0]));
}
}

Expand Down
Loading