Skip to content

Commit

Permalink
Don't open non-binlog files from clipboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed Sep 3, 2024
1 parent e668c62 commit 77144fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/StructuredLogViewer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ private bool TryOpenFromClipboard()

text = text.TrimStart('"').TrimEnd('"');

if (!text.EndsWith(".binlog", StringComparison.OrdinalIgnoreCase))
{
return false;
}

// only open a file from clipboard if it's not listed in the recent files
var recentFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
recentFiles.UnionWith(SettingsService.GetRecentLogFiles());
Expand Down

0 comments on commit 77144fa

Please sign in to comment.