mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
Fixed bug #3529455 (uri string is too long) and a minor Imgur history form nuisance.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1908 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
d44ae4f713
commit
7918109284
3 changed files with 23 additions and 5 deletions
|
@ -3,7 +3,7 @@ Greenshot: A screenshot tool optimized for productivity. Save a screenshot or a
|
|||
|
||||
CHANGE LOG:
|
||||
|
||||
1.0.0 build 1905 (Unstable, meaning we are in testing fase and haven't released yet)
|
||||
1.0.0 build 1908 (Unstable, meaning we are in testing fase and haven't released yet)
|
||||
|
||||
We changed the version to 1.0.0, after 5 year the version should no longer have a "beta" feeling!
|
||||
|
||||
|
|
|
@ -114,12 +114,12 @@ namespace GreenshotImgurPlugin {
|
|||
|
||||
private void DeleteButtonClick(object sender, EventArgs e) {
|
||||
if (listview_imgur_uploads.SelectedItems != null && listview_imgur_uploads.SelectedItems.Count > 0) {
|
||||
// Should fix Bug #3378699
|
||||
pictureBox1.Image = pictureBox1.ErrorImage;
|
||||
for (int i = 0; i < listview_imgur_uploads.SelectedItems.Count; i++) {
|
||||
ImgurInfo imgurInfo = (ImgurInfo)listview_imgur_uploads.SelectedItems[i].Tag;
|
||||
DialogResult result = MessageBox.Show(Language.GetFormattedString("imgur", LangKey.delete_question, imgurInfo.Title), Language.GetFormattedString("imgur", LangKey.delete_title, imgurInfo.Hash), MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (result == DialogResult.Yes) {
|
||||
// Should fix Bug #3378699
|
||||
pictureBox1.Image = pictureBox1.ErrorImage;
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(ImgurPlugin.Attributes.Name, Language.GetString("imgur", LangKey.communication_wait));
|
||||
try {
|
||||
ImgurUtils.DeleteImgurImage(imgurInfo);
|
||||
|
|
|
@ -79,9 +79,27 @@ namespace GreenshotImgurPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
private static string EscapeText(string Text) {
|
||||
/// <summary>
|
||||
/// A wrapper around the EscapeDataString, as the limit is 32766 characters
|
||||
/// See: http://msdn.microsoft.com/en-us/library/system.uri.escapedatastring%28v=vs.110%29.aspx
|
||||
/// </summary>
|
||||
/// <param name="dataString"></param>
|
||||
/// <returns>escaped data string</returns>
|
||||
private static StringBuilder EscapeDataStringToStringBuilder(string dataString) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
int currentLocation = 0;
|
||||
while (currentLocation < dataString.Length) {
|
||||
string process = dataString.Substring(currentLocation,Math.Min(16384, dataString.Length-currentLocation));
|
||||
result.Append(Uri.EscapeDataString(process));
|
||||
currentLocation = currentLocation + 16384;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string EscapeText(string text) {
|
||||
string[] UriRfc3986CharsToEscape = new[] { "!", "*", "'", "(", ")" };
|
||||
StringBuilder escaped = new StringBuilder(Uri.EscapeDataString(Text.ToString()));
|
||||
LOG.DebugFormat("Text size {0}", text.Length);
|
||||
StringBuilder escaped = EscapeDataStringToStringBuilder(text);
|
||||
|
||||
for (int i = 0; i < UriRfc3986CharsToEscape.Length; i++) {
|
||||
escaped.Replace(UriRfc3986CharsToEscape[i], Uri.HexEscape(UriRfc3986CharsToEscape[i][0]));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue