mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-09 14:34:05 +02:00
Fix new image url parser not checking if an extension already exists
This commit is contained in:
parent
5e3bd31862
commit
1113e0b559
@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using TweetLib.Core.Utils;
|
||||
|
||||
@ -55,7 +56,9 @@ public static bool TryParse(string url, out ImageUrl obj){
|
||||
return false;
|
||||
}
|
||||
|
||||
obj = new ImageUrl(url.Substring(0, question) + imageExtension, imageQuality);
|
||||
string originalUrl = url.Substring(0, question);
|
||||
|
||||
obj = new ImageUrl(Path.HasExtension(originalUrl) ? originalUrl : originalUrl + imageExtension, imageQuality);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user