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