From b10439f3dae4371299828ff8eae6a8e1f2ad357c Mon Sep 17 00:00:00 2001 From: John Kingsbury <57527020+JohnKingsbury@users.noreply.github.com> Date: Fri, 2 Oct 2020 22:26:27 +0100 Subject: [PATCH] Move comment to a place that makes sense. --- AngelLoader/Core.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AngelLoader/Core.cs b/AngelLoader/Core.cs index bd2462344..7124329d4 100644 --- a/AngelLoader/Core.cs +++ b/AngelLoader/Core.cs @@ -1338,14 +1338,14 @@ internal static void OpenWebSearchUrl(string fmTitle) string url = Config.WebSearchUrl; if (url.IsWhiteSpace() || url.Length > 32766) return; - url = Uri.EscapeUriString(url); - - int index = url.IndexOf("$TITLE$", StringComparison.OrdinalIgnoreCase); - // Possible exceptions are: // ArgumentNullException (stringToEscape is null) // UriFormatException (The length of stringToEscape exceeds 32766 characters) // Those are both checked for above so we're good. + url = Uri.EscapeUriString(url); + + int index = url.IndexOf("$TITLE$", StringComparison.OrdinalIgnoreCase); + string finalUrl = index == -1 ? url : url.Substring(0, index) + Uri.EscapeDataString(fmTitle) + url.Substring(index + "$TITLE$".Length);