mirror of https://github.com/ppy/osu
Merge pull request #30024 from peppy/edit-url-decode
Fix editor timestamp URLs not working when they contain a space
This commit is contained in:
commit
a9818854f4
|
@ -100,6 +100,20 @@ public void TestHandleCurrentScreenChanges()
|
|||
assertOnScreenAt(EditorScreenMode.Compose, 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUrlDecodingOfArgs()
|
||||
{
|
||||
setUpEditor(new OsuRuleset().RulesetInfo);
|
||||
AddAssert("is osu! ruleset", () => editorBeatmap.BeatmapInfo.Ruleset.Equals(new OsuRuleset().RulesetInfo));
|
||||
|
||||
AddStep("jump to encoded link", () => Game.HandleLink("osu://edit/00:14:142%20(1)"));
|
||||
|
||||
AddUntilStep("wait for seek", () => editorClock.SeekingOrStopped.Value);
|
||||
|
||||
AddAssert("time is correct", () => editorClock.CurrentTime, () => Is.EqualTo(14_142));
|
||||
AddAssert("selected object is correct", () => editorBeatmap.SelectedHitObjects.Single().StartTime, () => Is.EqualTo(14_142));
|
||||
}
|
||||
|
||||
private void addStepClickLink(string timestamp, string step = "", bool waitForSeek = true)
|
||||
{
|
||||
AddStep($"{step} {timestamp}", () =>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
|
||||
|
@ -234,7 +235,7 @@ public static LinkDetails GetLinkDetails(string url)
|
|||
return new LinkDetails(LinkAction.External, url);
|
||||
}
|
||||
|
||||
return new LinkDetails(linkType, args[2]);
|
||||
return new LinkDetails(linkType, HttpUtility.UrlDecode(args[2]));
|
||||
|
||||
case "osump":
|
||||
return new LinkDetails(LinkAction.JoinMultiplayerMatch, args[1]);
|
||||
|
|
Loading…
Reference in New Issue