1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed some characters not being allowed as Paste passwords.

This commit is contained in:
Uncled1023 2016-07-01 09:50:10 -07:00
parent 140d0a0371
commit 7aaa5e922b
4 changed files with 13 additions and 9 deletions

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)
{

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

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

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