diff --git a/source/about.pas b/source/about.pas index 19eb4c1a..a6e3873c 100644 --- a/source/about.pas +++ b/source/about.pas @@ -122,9 +122,9 @@ begin lblAppName.Caption := APPNAME; lblAppVersion.Caption := _('Version') + ' ' + Mainform.AppVersion + ' (' + IntToStr(GetExecutableBits) + ' Bit)'; lblAppCompiled.Caption := _('Compiled on:') + ' ' + DateTimeToStr(GetImageLinkTimeStamp(Application.ExeName)); - lblAppWebpage.Caption := GetAppWebsite(True); - lblAppWebpage.Hint := GetAppWebsite(True)+'?place='+EncodeURLParam(lblAppWebpage.Name); - ImageHeidisql.Hint := GetAppWebsite(True)+'?place='+EncodeURLParam(ImageHeidisql.Name); + lblAppWebpage.Caption := APPDOMAIN; + lblAppWebpage.Hint := APPDOMAIN+'?place='+EncodeURLParam(lblAppWebpage.Name); + ImageHeidisql.Hint := APPDOMAIN+'?place='+EncodeURLParam(ImageHeidisql.Name); Screen.Cursor := crDefault; end; diff --git a/source/const.inc b/source/const.inc index 92b026b3..1c54c6a8 100644 --- a/source/const.inc +++ b/source/const.inc @@ -12,7 +12,7 @@ const // General things APPNAME = 'HeidiSQL'; - APPDOMAIN = 'www.heidisql.com'; + APPDOMAIN = 'https://www.heidisql.com/'; REGKEY_SESSIONS = 'Servers'; REGKEY_QUERYHISTORY = 'QueryHistory'; REGKEY_RECENTFILTERS = 'RecentFilters'; diff --git a/source/exportgrid.pas b/source/exportgrid.pas index d1ed73e2..409e6350 100644 --- a/source/exportgrid.pas +++ b/source/exportgrid.pas @@ -926,7 +926,7 @@ begin ' ' + CRLF + CRLF + '

' + CRLF + ' generated ' + DateToStr(now) + ' ' + TimeToStr(now) + - ' by ' + APPNAME + ' ' + Mainform.AppVersion + '' + CRLF + + ' by ' + APPNAME + ' ' + Mainform.AppVersion + '' + CRLF + '

' + CRLF + CRLF + ' ' + CRLF + '' + CRLF; diff --git a/source/helpers.pas b/source/helpers.pas index b64b5cad..654463a6 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -337,7 +337,6 @@ type procedure Help(Sender: TObject; Anchor: String); function PortOpen(Port: Word): Boolean; function IsValidFilePath(FilePath: String): Boolean; - function GetAppWebsite(Secure: Boolean): String; var @@ -2771,7 +2770,7 @@ begin Place := 'unhandled-'+Sender.ClassName; if IsNotEmpty(Anchor) then Anchor := '#'+Anchor; - ShellExec(GetAppWebsite(True)+'help.php?place='+EncodeURLParam(Place)+Anchor); + ShellExec(APPDOMAIN+'help.php?place='+EncodeURLParam(Place)+Anchor); end; @@ -2814,16 +2813,6 @@ begin end; -function GetAppWebsite(Secure: Boolean): String; -begin - // Get project web url, with or without ssl - if Secure then - Result := 'https://' + APPDOMAIN + '/' - else - Result := 'http://' + APPDOMAIN + '/'; -end; - - { Threading stuff } diff --git a/source/main.pas b/source/main.pas index f664e2c0..3c150cef 100644 --- a/source/main.pas +++ b/source/main.pas @@ -1997,7 +1997,7 @@ begin if DaysBetween(Now, LastStatsCall) >= 30 then begin // Report used SVN revision StatsCall := THttpDownload.Create(Self); - StatsCall.URL := GetAppWebsite(True) + 'savestats.php?c=' + IntToStr(FAppVerRevision) + '&bits=' + IntToStr(GetExecutableBits); + StatsCall.URL := APPDOMAIN + 'savestats.php?c=' + IntToStr(FAppVerRevision) + '&bits=' + IntToStr(GetExecutableBits); // Enumerate actively used server versions for i:=0 to SessionPaths.Count-1 do begin AppSettings.SessionPath := SessionPaths[i]; @@ -2509,7 +2509,7 @@ begin ErrorDialog(f_('Could not determine parent form of this %s', [Sender.ClassName])) else begin place := LowerCase(Dialog.UnitName); - ShellExec(GetAppWebsite(True) + 'donatebutton.php?place=' + EncodeURLParam(place)); + ShellExec(APPDOMAIN + 'donatebutton.php?place=' + EncodeURLParam(place)); end; end; @@ -12156,17 +12156,26 @@ begin FHasDonatedDatabaseCheck := nbFalse; end else begin // Check heidisql.com/hasdonated.php?email=... - // HasDonatedDatabaseCheck + // FHasDonatedDatabaseCheck // = 0 : No check yet done // = 1 : Not a donor // = 2 : Valid donor rx := TRegExpr.Create; CheckWebpage := THttpDownload.Create(MainForm); - CheckWebpage.URL := GetAppWebsite(True) + 'hasdonated.php?email='+EncodeURLParam(Email); + CheckWebpage.URL := APPDOMAIN + 'hasdonated.php?email='+EncodeURLParam(Email); CheckWebpage.TimeOut := 3; TempFileName := GetTempDir + '\' + APPNAME + '_hasdonated_check.tmp'; try - CheckWebpage.SendRequest(TempFileName); + try + CheckWebpage.SendRequest(TempFileName); + except + on E:Exception do begin + // Try again without SSL. See issue #65 + MainForm.LogSQL(E.Message, lcError); + CheckWebpage.URL := ReplaceRegExpr('^https:', CheckWebpage.URL, 'http:'); + CheckWebpage.SendRequest(TempFileName); + end; + end; CheckResult := ReadTextFile(TempFileName, TEncoding.Default); SysUtils.DeleteFile(TempFileName); rx.Expression := '^\d+$'; diff --git a/source/sqlhelp.pas b/source/sqlhelp.pas index 0cfd2965..d842f442 100644 --- a/source/sqlhelp.pas +++ b/source/sqlhelp.pas @@ -278,7 +278,7 @@ end; procedure TfrmSQLhelp.ButtonOnlinehelpClick(Sender: TObject); begin // Link/redirect to mysql.com for further help - ShellExec(GetAppWebsite(True) + 'sqlhelp.php?mysqlversion='+inttostr(MainForm.ActiveConnection.ServerVersionInt)+ + ShellExec(APPDOMAIN + 'sqlhelp.php?mysqlversion='+inttostr(MainForm.ActiveConnection.ServerVersionInt)+ '&keyword='+EncodeURLParam(keyword)); end; diff --git a/source/updatecheck.pas b/source/updatecheck.pas index 83194aec..632f9a86 100644 --- a/source/updatecheck.pas +++ b/source/updatecheck.pas @@ -119,7 +119,7 @@ begin // Prepare download CheckfileDownload := THttpDownload.Create(Self); CheckfileDownload.TimeOut := 5; - CheckfileDownload.URL := GetAppWebsite(True)+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&bits='+IntToStr(GetExecutableBits)+'&t='+DateTimeToStr(Now); + CheckfileDownload.URL := APPDOMAIN+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&bits='+IntToStr(GetExecutableBits)+'&t='+DateTimeToStr(Now); CheckFilename := GetTempDir + APPNAME + '_updatecheck.ini'; // Download the check file @@ -177,13 +177,13 @@ end; } procedure TfrmUpdateCheck.btnReleaseClick(Sender: TObject); begin - ShellExec(GetAppWebsite(True)+'download.php?download=installer'); + ShellExec(APPDOMAIN+'download.php?download=installer'); end; procedure TfrmUpdateCheck.btnChangelogClick(Sender: TObject); begin - ShellExec(GetAppWebsite(True)+'download.php?place='+EncodeURLParam(TButton(Sender).Name)+'#nightlybuilds'); + ShellExec(APPDOMAIN+'download.php?place='+EncodeURLParam(TButton(Sender).Name)+'#nightlybuilds'); end;