From 248eaa748dfc3c381bdab3c639c91e09ab7ae34e Mon Sep 17 00:00:00 2001 From: RKrom Date: Fri, 7 Nov 2014 21:49:55 +0100 Subject: [PATCH] Fix for BUG-1695 --- .../releases/additional_files/readme.txt.template | 1 + GreenshotImgurPlugin/ImgurInfo.cs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Greenshot/releases/additional_files/readme.txt.template b/Greenshot/releases/additional_files/readme.txt.template index 0a366a273..90ac369fd 100644 --- a/Greenshot/releases/additional_files/readme.txt.template +++ b/Greenshot/releases/additional_files/readme.txt.template @@ -20,6 +20,7 @@ Changes: Bugs Resolved: * BUG-1667: removed horizontal alignment of textbox in input mode, as it caused problems with textbox focus and could not be implemented consistently anyway (no vertical alignment possible) * BUG-1681: Improvements for the new speech bubble, text color is now the same as the border and the rounded corners are correctly calculated when using thick lines and a small bubble. +* BUG-1695: Fixed an issue with processing the response from Imgur, which caused the error "Value cannot be null. Parameter name: key" 1.2.1.2-af946cf RC1 diff --git a/GreenshotImgurPlugin/ImgurInfo.cs b/GreenshotImgurPlugin/ImgurInfo.cs index 1957b169a..04ba0263b 100644 --- a/GreenshotImgurPlugin/ImgurInfo.cs +++ b/GreenshotImgurPlugin/ImgurInfo.cs @@ -129,6 +129,16 @@ namespace GreenshotImgurPlugin } public static ImgurInfo ParseResponse(string response) { LOG.Debug(response); + // This is actually a hack for BUG-1695 + // The problem is the (C) sign, we send it HTML encoded "®" to Imgur and get it HTML encoded in the XML back + // Added all the encodings I found quickly, I guess these are not all... but it should fix the issue for now. + response = response.Replace("¢", "¢"); + response = response.Replace("£", "£"); + response = response.Replace("¥", "¥"); + response = response.Replace("€", "€"); + response = response.Replace("©", "©"); + response = response.Replace("®", "®"); + ImgurInfo imgurInfo = new ImgurInfo(); try { XmlDocument doc = new XmlDocument();