mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-14 00:48:26 +08:00
Fix: LFI vulnerability in document parsing API (#13196)
### What problem does this PR solve? Fix LFI vulnerability in document parsing API. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -19,7 +19,7 @@ from rag.nlp import find_codec
|
||||
|
||||
def get_text(fnm: str, binary=None) -> str:
|
||||
txt = ""
|
||||
if binary:
|
||||
if binary is not None:
|
||||
encoding = find_codec(binary)
|
||||
txt = binary.decode(encoding, errors="ignore")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user