Selaa lähdekoodia

Limiting error report (and generally any URL) to 4 KB.

(cherry picked from commit 1924c282b5763916a61a3b290073d3c9740a8cd0)

Source commit: 1e38cb5df651444e02d348d1231139c7f8d95b9c
Martin Prikryl 5 vuotta sitten
vanhempi
sitoutus
922b8bb1be
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      source/windows/Tools.cpp

+ 6 - 0
source/windows/Tools.cpp

@@ -753,6 +753,12 @@ void __fastcall OpenBrowser(UnicodeString URL)
   }
   if (!CopyCommandToClipboard(URL))
   {
+    // Rather arbitrary limit. Opening a URL over approx. 5 KB fails in Chrome, Firefox and Edge.
+    const int URLLimit = 4*1024;
+    if (URL.Length() > URLLimit)
+    {
+      URL.SetLength(URLLimit);
+    }
     ShellExecute(Application->Handle, L"open", URL.c_str(), NULL, NULL, SW_SHOWNORMAL);
   }
 }