Skip to content

Commit b96c994

Browse files
committed
more cleanup
1 parent 5467507 commit b96c994

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

FlashpointSecurePlayer/Shared.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,16 +2017,17 @@ public static string GetValidatedURL(string url) {
20172017

20182018
// workaround: we always want to use HTTP, regardless of the default
20192019
// (in case the default is HTTPS)
2020-
if (err != S_FALSE) {
2021-
// skip leading slashes for protocol-less URLs
2022-
const string LEADING_SLASHES = "//";
2020+
if (err == S_FALSE) {
2021+
return url;
2022+
}
20232023

2024-
if (url.StartsWith(LEADING_SLASHES, StringComparison.Ordinal)) {
2025-
url = url.Substring(LEADING_SLASHES.Length);
2026-
}
2027-
return URI_SCHEME_HTTP + "://" + url;
2024+
// skip leading slashes for protocol-less URLs
2025+
const string LEADING_SLASHES = "//";
2026+
2027+
if (url.StartsWith(LEADING_SLASHES, StringComparison.Ordinal)) {
2028+
url = url.Substring(LEADING_SLASHES.Length);
20282029
}
2029-
return url;
2030+
return URI_SCHEME_HTTP + "://" + url;
20302031
}
20312032

20322033
public static bool TestInternetURI(Uri uri) {

0 commit comments

Comments
 (0)