Excplicitly check that urls start with http:// or https://

This is slightly better than macthing only "http"

Found by ZeroPath

Reported by: Joshua Rogers <joshua@joshua.hu>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
master
Selva Nair 2025-10-25 16:59:44 -04:00 committed by Lev Stipakov
parent fff2048802
commit db520488af
1 changed files with 1 additions and 1 deletions

2
misc.c
View File

@ -745,7 +745,7 @@ md_final(md_ctx *ctx, BYTE *md)
BOOL
open_url(const wchar_t *url)
{
if (!url || !wcsbegins(url, L"http"))
if (!url || (!wcsbegins(url, L"http://") && !wcsbegins(url, L"https://")))
{
return false;
}