From 85e8a594471e45f35780faa21169f9c8dc4c64ec Mon Sep 17 00:00:00 2001 From: RKrom Date: Mon, 16 Dec 2013 16:24:39 +0100 Subject: [PATCH] * Fix for bug [#1578], making the Imgur filename configurable and having the current time in the default pattern fixes the information leak. --- GreenshotImgurPlugin/ImgurConfiguration.cs | 4 +++- GreenshotImgurPlugin/ImgurPlugin.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/GreenshotImgurPlugin/ImgurConfiguration.cs b/GreenshotImgurPlugin/ImgurConfiguration.cs index 93ff9193c..435913cb5 100644 --- a/GreenshotImgurPlugin/ImgurConfiguration.cs +++ b/GreenshotImgurPlugin/ImgurConfiguration.cs @@ -51,7 +51,9 @@ namespace GreenshotImgurPlugin { public bool AddTitle; [IniProperty("AddFilename", Description = "Is the filename passed on to Imgur", DefaultValue = "True")] public bool AddFilename; - + [IniProperty("FilenamePattern", Description = "Filename for the Imgur upload", DefaultValue = "${capturetime:d\"yyyyMMdd-HHmm\"}")] + public string FilenamePattern; + [IniProperty("ImgurUploadHistory", Description="Imgur upload history (ImgurUploadHistory.hash=deleteHash)")] public Dictionary ImgurUploadHistory; diff --git a/GreenshotImgurPlugin/ImgurPlugin.cs b/GreenshotImgurPlugin/ImgurPlugin.cs index 30ebb7bd7..f69ac6151 100644 --- a/GreenshotImgurPlugin/ImgurPlugin.cs +++ b/GreenshotImgurPlugin/ImgurPlugin.cs @@ -172,7 +172,7 @@ namespace GreenshotImgurPlugin { public bool Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload, out string uploadURL) { SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors); try { - string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails)); + string filename = Path.GetFileName(FilenameHelper.GetFilenameFromPattern(config.FilenamePattern, config.UploadFormat, captureDetails)); ImgurInfo imgurInfo = null; // Run upload in the background