rebrand
This commit is contained in:
parent
ae6abc104a
commit
5de53a3cba
256 changed files with 22 additions and 22 deletions
20
src/appled/Controllers/SafeNameAttribute.cs
Normal file
20
src/appled/Controllers/SafeNameAttribute.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
|
||||
namespace nuget_host.Controllers
|
||||
{
|
||||
internal class SafeNameAttribute : ValidationAttribute
|
||||
{
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
if (!(value is string))
|
||||
return false;
|
||||
string str = value as string;
|
||||
if (str.Length>126) return false;
|
||||
if (str.Any(c => !char.IsLetterOrDigit(c)
|
||||
&& !"-_.".Contains(c))) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue