Browse Source

Fixed some characters not being allowed as Paste passwords.

tags/2.0.3
Teknikode 4 years ago
parent
commit
7aaa5e922b

+ 1
- 1
Teknik/Areas/Paste/Controllers/PasteController.cs View File

@@ -152,7 +152,7 @@ namespace Teknik.Areas.Paste.Controllers
db.Pastes.Add(paste);
db.SaveChanges();

return Redirect(Url.SubRouteUrl("p", "Paste.View", new { type = "Full", url = paste.Url, password = model.Password }));
return Redirect(Url.SubRouteUrl("p", "Paste.View", new { type = "Full", url = paste.Url }));
}
catch (Exception ex)
{

+ 8
- 8
Teknik/Areas/Paste/PasteAreaRegistration.cs View File

@@ -39,24 +39,24 @@ namespace Teknik.Areas.Paste
"Paste.Simple", // Route name
new List<string>() { "paste", "p" },
new List<string>() { config.Host }, // domains
"Simple/{url}/{password}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Simple", password = UrlParameter.Optional }, // Parameter defaults
"Simple/{url}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Simple" }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
"Paste.Raw", // Route name
new List<string>() { "paste", "p" },
new List<string>() { config.Host }, // domains
"Raw/{url}/{password}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Raw", password = UrlParameter.Optional }, // Parameter defaults
"Raw/{url}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Raw" }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
"Paste.Download", // Route name
new List<string>() { "paste", "p" },
new List<string>() { config.Host }, // domains
"Download/{url}/{password}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Download", password = UrlParameter.Optional }, // Parameter defaults
"Download/{url}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Download" }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
@@ -71,8 +71,8 @@ namespace Teknik.Areas.Paste
"Paste.View", // Route name
new List<string>() { "paste", "p" },
new List<string>() { config.Host }, // domains
"{url}/{password}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Full", password = UrlParameter.Optional }, // Parameter defaults
"{url}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Full" }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);


+ 1
- 0
Teknik/Areas/Paste/ViewModels/PasteCreateViewModel.cs View File

@@ -23,6 +23,7 @@ namespace Teknik.Areas.Paste.ViewModels

public string ExpireUnit { get; set; }

[AllowHtml]
public string Password { get; set; }

public bool Hide { get; set; }

+ 3
- 0
Teknik/Areas/Paste/ViewModels/PasteViewModel.cs View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using Teknik.ViewModels;

namespace Teknik.Areas.Paste.ViewModels
@@ -10,9 +11,11 @@ namespace Teknik.Areas.Paste.ViewModels
public class PasteViewModel : ViewModelBase
{
public string Url { get; set; }
[AllowHtml]
public string Content { get; set; }
public string Title { get; set; }
public string Syntax { get; set; }
[AllowHtml]
public string Password { get; set; }
public bool Hide { get; set; }
public DateTime DatePosted { get; set; }

Loading…
Cancel
Save