Skip to content

Commit d2040dd

Browse files
author
rootware
committed
Fixed the api from not identifying base64 text.
1 parent 18a8276 commit d2040dd

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ and simply didn't have the time to go back and retroactively create one.
1818

1919
- None at the moment.
2020

21+
## [0.3.9] - 2022-07-27
22+
23+
Fixed the api from not identifying base64 text.
24+
25+
### Changed
26+
27+
- Fixed the api from not identifying base64 text.
28+
2129
## [0.3.8] - 2022-07-26
2230

2331
PyRedactKit can now smartly detect if your input is a text sentence or a file thanks to the latest AI based on 'If,else' implemented by the author. :D

pyredactkit/core_redactor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ def identify_data(self, textchunk: str) -> list:
4343
list (list): list of sensitive data found in lines
4444
"""
4545
sensitive_data = []
46-
for id in id_object.regexes:
47-
redact_pattern = id['pattern']
48-
sensitive_data.append(re.findall(redact_pattern, textchunk))
49-
sensitive_data = sum(sensitive_data, [])
46+
for line in textchunk.splitlines():
47+
for id in id_object.regexes:
48+
redact_pattern = id['pattern']
49+
if re.search(redact_pattern, line):
50+
sensitive_data.append(line)
5051
return sensitive_data
5152

5253
def redact_all(self, line: str) -> tuple:

0 commit comments

Comments
 (0)