Skip to content

Commit

Permalink
Move comment to a place that makes sense.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnKingsbury committed Oct 2, 2020
1 parent 864216e commit b10439f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions AngelLoader/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b10439f

Please sign in to comment.