check: fixed for empty markers in header post

This commit is contained in:
Cyrille L 2022-11-25 17:33:54 +01:00
parent 0560c4665c
commit a2045a62ba
1 changed files with 15 additions and 6 deletions

View File

@ -419,6 +419,7 @@ def if_mandat_marker(marker, m_in):
m_in[1], marker m_in[1], marker
) )
log.append_f(post_logs, msg_log, 1) log.append_f(post_logs, msg_log, 1)
Post_Err = True
#================================# #================================#
# Check Date format and validity # # Check Date format and validity #
@ -499,12 +500,21 @@ def check_links(line, ln, stats_links_uniq):
global Post_Err, stats_links_p global Post_Err, stats_links_p
# Create variable array # Create variable array
try: link_name = line.split('link:')[1].lstrip()
except: link_name = ''
try: link_url = headers.rsplit('\n')[ln].lstrip()
except: link_url = ''
try: link_alt = headers.rsplit('\n')[ln+1].lstrip()
except: link_alt = ''
if not link_name:
msg_log = 'Line %s. Unused NAME for marker "link:"'%ln
log.append_f(post_logs,msg_log,1)
Post_Err = True
return(1)
link_nbr = 'link_%s'%stats_links_uniq link_nbr = 'link_%s'%stats_links_uniq
link_name = line.split('link:')[1].lstrip() # Check 2nd line
link_url = headers.rsplit('\n')[ln].lstrip()
link_alt = headers.rsplit('\n')[ln+1].lstrip()
# Check 2nd line
check_new_marker(link_url) check_new_marker(link_url)
if new_marker: link_url = '' if new_marker: link_url = ''
@ -530,7 +540,6 @@ def check_links(line, ln, stats_links_uniq):
log.append_f(post_logs,msg_log,1) log.append_f(post_logs,msg_log,1)
Post_Err = True Post_Err = True
if Post_Err: return if Post_Err: return
# Set final marker_N # Set final marker_N
link = ( link = (