Przeglądaj źródła

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

Source commit: f5779b20c1876860f276c21619230a88a86f0dfc
Martin Prikryl 5 lat temu
rodzic
commit
1924c282b5
1 zmienionych plików z 6 dodań i 0 usunięć
  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);
   }
 }