mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
use StringBuilder in GetValidFilename
This commit is contained in:
parent
229e050cd3
commit
1496991096
@ -106,13 +106,15 @@ namespace MediaBrowser.Controller.IO
|
|||||||
{
|
{
|
||||||
throw new ArgumentNullException("filename");
|
throw new ArgumentNullException("filename");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var builder = new StringBuilder(filename);
|
||||||
|
|
||||||
foreach (var c in InvalidFileNameChars)
|
foreach (var c in InvalidFileNameChars)
|
||||||
{
|
{
|
||||||
filename = filename.Replace(c, SpaceChar);
|
builder = builder.Replace(c, SpaceChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
return filename;
|
return builder.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user