Revert a part of commit 976dd6b7420232c4dba631391743ef44cf95a935: do not generate hyperlinks for local file paths, which get broken too often due to unsupported spaces.

This commit is contained in:
Ansgar Becker
2022-01-01 12:38:45 +01:00
parent d7d2993c35
commit 210f056c47

View File

@ -2307,10 +2307,7 @@ begin
if Assigned(MainForm) and (MainForm.ActiveConnection <> nil) then if Assigned(MainForm) and (MainForm.ActiveConnection <> nil) then
Dialog.Caption := MainForm.ActiveConnection.Parameters.SessionName + ': ' + Dialog.Caption; Dialog.Caption := MainForm.ActiveConnection.Parameters.SessionName + ': ' + Dialog.Caption;
rx := TRegExpr.Create; rx := TRegExpr.Create;
// This expression does not correctly detect filenames with all allowed characters, for which we would rx.Expression := 'https?://\S+';
// need to take TPath.GetInvalidPathChars into account. But to not excessively eat parts of the following
// text, we stop at the first space character
rx.Expression := '(https?://|[A-Z]\:\\)\S+';
Dialog.Text := rx.Replace(Msg, '<a href="$0">$0</a>', True); Dialog.Text := rx.Replace(Msg, '<a href="$0">$0</a>', True);
rx.Free; rx.Free;