mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
Core: Fix file path out of range detection
This commit is contained in:
parent
89e07b7bcb
commit
b8a24e30bf
|
@ -13,9 +13,6 @@ namespace BililiveRecorder.Core.Templating
|
|||
{
|
||||
public sealed class FileNameGenerator
|
||||
{
|
||||
// TODO: 需要改得更通用一些
|
||||
// 日志不应该一定绑定到一个直播间上
|
||||
|
||||
private static readonly FluidParser parser;
|
||||
private static readonly IFluidTemplate defaultTemplate;
|
||||
|
||||
|
@ -112,7 +109,7 @@ namespace BililiveRecorder.Core.Templating
|
|||
|
||||
fullPath = skipFullPath ? null : Path.GetFullPath(Path.Combine(workDirectory, relativePath));
|
||||
|
||||
if (!skipFullPath && !CheckIsWithinPath(workDirectory!, Path.GetDirectoryName(fullPath)))
|
||||
if (!skipFullPath && !CheckIsWithinPath(workDirectory!, fullPath!))
|
||||
{
|
||||
this.logger.Warning("录制文件位置超出允许范围,请检查设置。将写入到默认路径。");
|
||||
status = FileNameTemplateStatus.OutOfRange;
|
||||
|
|
Loading…
Reference in New Issue
Block a user