From e6e02ea30ed02ccad719f90b35173cf178bb259c Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Fri, 7 Apr 2023 16:36:46 +0200 Subject: [PATCH] Fix regex at check to search some specific characters in NAME --- src/var/lib/tyto/program/check.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 7d124be..ab6fb6c 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -519,7 +519,7 @@ def check_3lines(tag, ln, line): logs.out("2", 'L=%s. "%s: %s" > %s'%( ln, tag, langs.site.name, db.uri_file ), False) - post_err = True + post_err = True # abbr: elif tag == "abbr": @@ -531,7 +531,7 @@ def check_3lines(tag, ln, line): check_snpic(name) return - elif not isin(r'\b%s\b'%(opt_tags_post_name[tag]%name), post_bottom): + elif not isin("%s"%(opt_tags_post_name[tag]%name), post_bottom): logs.out("12", '"%s" > %s'%( opt_tags_post_name[tag]%name, db.uri_file ), False) @@ -587,10 +587,11 @@ def check_3lines(tag, ln, line): # Find in post_bottom # #---------------------# def isin(term, post_file): - for line in post_file.rsplit('\n'): - if re.search(term, line): - return(True) - return(False) + paterm = re.escape(term) + + if re.search(paterm, post_file): return(True) + else: return(False) + #===================================#