Spaces:
Runtime error
Runtime error
fix: allow semicolons and >= in quoted FFmpeg filter expressions
Browse files30 unmodified lines313233343536373830 unmodified linesdef sanitize_ffmpeg_args(args: str) -> str:"""Raise ValueError if args contain blocked shell patterns."""if _BLOCKED_RE.search(args):raise ValueError("Blocked pattern detected in ffmpeg_args. ""Shell operators, file deletion, and system commands are not allowed."30 unmodified lines3132333435363738394041424330 unmodified linesdef sanitize_ffmpeg_args(args: str) -> str:"""Raise ValueError if args contain blocked shell patterns outside of quotes."""# Strip double-quoted and single-quoted strings before checking.# This allows FFmpeg filter_complex to use ; and other shell-like# characters inside quoted filter expressions.stripped = re.sub(r'"[^"]*"', '""', args)stripped = re.sub(r"'[^']*'", "''", stripped)if _BLOCKED_RE.search(stripped):raise ValueError("Blocked pattern detected in ffmpeg_args. ""Shell operators, file deletion, and system commands are not allowed."
ffmpeg_runner.py+7-2