fixed #278: Fixed custom uploader input issue

This commit is contained in:
Jaex 2014-09-12 08:38:37 +03:00
parent d6b78b9d01
commit 5cbae85c05
5 changed files with 9 additions and 13 deletions

View file

@ -215,7 +215,7 @@ public static string ToolsFolder
#endregion Paths
public static bool IsBeta = false;
public static bool IsBeta = true;
public static string Title
{

View file

@ -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")]

View file

@ -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);
}

View file

@ -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();

View file

@ -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 };