diff options
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index a902d197d..f6b00e421 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -359,6 +359,15 @@ void MakeNewgameSettingsLive() } } +void OpenBrowser(const char *url) +{ + /* Make sure we only accept urls that are sure to open a browser. */ + if (strstr(url, "http://") != url && strstr(url, "https://") != url) return; + + extern void OSOpenBrowser(const char *url); + OSOpenBrowser(url); +} + /** Callback structure of statements to be executed after the NewGRF scan. */ struct AfterNewGRFScan : NewGRFScanCallback { Year startyear; ///< The start year. |