Skip to content

Commit 2af52cb

Browse files
committed
Add svg file check method
1 parent 86df1f1 commit 2af52cb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/Files.Shared/Helpers/FileExtensionHelpers.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public static bool IsPdfFile(string? fileExtensionToCheck)
353353
/// <returns><c>true</c> if the <c>filePathToCheck</c> is an HTML file; otherwise, <c>false</c>.</returns>
354354
public static bool IsHtmlFile(string? fileExtensionToCheck)
355355
{
356-
return HasExtension(fileExtensionToCheck, ".html", ".htm", ".xhtml", ".svg");
356+
return HasExtension(fileExtensionToCheck, ".html", ".htm", ".xhtml");
357357
}
358358

359359
/// <summary>
@@ -386,6 +386,16 @@ public static bool IsTextFile(string? fileExtensionToCheck)
386386
return HasExtension(fileExtensionToCheck, ".txt");
387387
}
388388

389+
/// <summary>
390+
/// Checks if the file extension represents an SVG file.
391+
/// </summary>
392+
/// <param name="fileExtensionToCheck">The file extension to check</param>
393+
/// <returns><c>true</c> if the <c>filePathToCheck</c> is an SVG file; otherwise, <c>false</c>.</returns>
394+
public static bool IsSvgFile(string? fileExtensionToCheck)
395+
{
396+
return HasExtension(fileExtensionToCheck, ".svg");
397+
}
398+
389399
/// <summary>
390400
/// Check if the file is signable.
391401
/// </summary>

0 commit comments

Comments
 (0)