Browse Source

updated to checking only some file extension

pull/3720/head
Ahmet 6 years ago
parent
commit
15824464e3
  1. 8
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Helpers/BlogNameControlHelper.cs

8
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Helpers/BlogNameControlHelper.cs

@ -1,19 +1,19 @@
using System.IO;
using System.Linq;
namespace Volo.Blogging.Pages.Blogs.Shared.Helpers
{
public static class BlogNameControlHelper
{
public static readonly string[] ProhibitedFileExtensions = new string[] {".ico", ".txt", ".php"};
public static bool IsFileFormat(string blogShortName)
{
if (!string.IsNullOrWhiteSpace(blogShortName))
{
var fileInfo = new FileInfo(blogShortName);
if (!string.IsNullOrEmpty(fileInfo.Extension))
{
return true;
}
return ProhibitedFileExtensions.Contains(fileInfo.Extension);
}
return false;

Loading…
Cancel
Save