mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
fixed #278: Fixed custom uploader input issue
This commit is contained in:
parent
d6b78b9d01
commit
5cbae85c05
5 changed files with 9 additions and 13 deletions
|
@ -215,7 +215,7 @@ public static string ToolsFolder
|
|||
|
||||
#endregion Paths
|
||||
|
||||
public static bool IsBeta = false;
|
||||
public static bool IsBeta = true;
|
||||
|
||||
public static string Title
|
||||
{
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("82E6AC09-0FEF-4390-AD9F-0DD3F5561EFC")]
|
||||
[assembly: AssemblyVersion("9.3.0")]
|
||||
[assembly: AssemblyFileVersion("9.3.0")]
|
||||
[assembly: AssemblyVersion("9.3.1")]
|
||||
[assembly: AssemblyFileVersion("9.3.1")]
|
|
@ -70,13 +70,9 @@ public Dictionary<string, string> ParseArguments(string input = null)
|
|||
{
|
||||
string value = arg.Value;
|
||||
|
||||
if (!string.IsNullOrEmpty(input))
|
||||
{
|
||||
value = value.Replace("%input", input);
|
||||
value = value.Replace("$input$", input);
|
||||
}
|
||||
|
||||
value = value.Replace("%input", "$input$"); // For backward compatibility
|
||||
value = NameParser.Parse(NameParserType.Text, value);
|
||||
value = value.Replace("$input$", input);
|
||||
|
||||
arguments.Add(arg.Key, value);
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@ public override UploadResult UploadText(string text, string fileName)
|
|||
if (string.IsNullOrEmpty(customUploader.RequestURL)) throw new Exception("'Request URL' must be not empty.");
|
||||
|
||||
if ((customUploader.RequestType == CustomUploaderRequestType.GET || string.IsNullOrEmpty(customUploader.FileFormName)) &&
|
||||
(customUploader.Arguments == null || !customUploader.Arguments.Any(x => x.Value.Contains("%input") || x.Value.Contains("$input$"))))
|
||||
throw new Exception("Atleast one '%input' or '$input$' required for argument value when using GET or non-file POST.");
|
||||
(customUploader.Arguments == null || !customUploader.Arguments.Any(x => x.Value.Contains("$input$") || x.Value.Contains("%input"))))
|
||||
throw new Exception("Atleast one '$input$' required for argument value when using GET or non-file POST.");
|
||||
|
||||
UploadResult result = new UploadResult();
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ public override UploadResult ShortenURL(string url)
|
|||
|
||||
if (string.IsNullOrEmpty(customUploader.RequestURL)) throw new Exception("'Request URL' must be not empty.");
|
||||
|
||||
if (customUploader.Arguments == null || !customUploader.Arguments.Any(x => x.Value.Contains("%input") || x.Value.Contains("$input$")))
|
||||
throw new Exception("Atleast one '%input' or '$input$' required for argument value when using custom URL shortener.");
|
||||
if (customUploader.Arguments == null || !customUploader.Arguments.Any(x => x.Value.Contains("$input$") || x.Value.Contains("%input")))
|
||||
throw new Exception("Atleast one '$input$' required for argument value when using custom URL shortener.");
|
||||
|
||||
UploadResult result = new UploadResult { URL = url };
|
||||
|
||||
|
|
Loading…
Reference in a new issue