Check OpenExternalWebBrowser custom flag better (#674)

Properly check string prefix to see if we should open it in browser
This commit is contained in:
Jack 2024-03-02 14:29:02 +00:00 committed by GitHub
parent ec5dc504bf
commit 026adbebe5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ void, __fastcall, (char* pUrl, char flags))
// clang-format on
{
bool bIsOriginOverlayEnabledOriginal = *bIsOriginOverlayEnabled;
if (flags & 2 && !strncmp(pUrl, "http", 4)) // custom force external browser flag
bool isHttp = !strncmp(pUrl, "http://", 7) || !strncmp(pUrl, "https://", 8);
if (flags & 2 && isHttp) // custom force external browser flag
*bIsOriginOverlayEnabled = false; // if this bool is false, game will use an external browser rather than the origin overlay one
OpenExternalWebBrowser(pUrl, flags);