diff --git a/docker-compose.yml b/docker-compose.yml index 2cb30ce..576a4b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ x-env: &template - image: fcb_photo_review:1.14.8 + image: fcb_photo_review:1.14.9 restart: always x-review: diff --git a/util/data_util.py b/util/data_util.py index 1504b5c..2d0a3ae 100644 --- a/util/data_util.py +++ b/util/data_util.py @@ -89,12 +89,16 @@ def handle_date(string): def handle_hospital(string): if not string: return "" + # 只允许汉字、数字 + string = re.sub(r'[^⺀-鿿0-9]', '', string) return string[:255] def handle_department(string): if not string: return "" + # 只允许汉字 + string = re.sub(r'[^⺀-鿿]', '', string) return string[:255] @@ -153,6 +157,8 @@ def handle_original_data(string): def handle_id(string): if not string: return "" + # 只允许字母和数字 + string = re.sub(r'[^0-9a-zA-Z]', '', string) # 防止过长存入数据库失败 return string[:50]