Переглянути джерело

/providers: sanitizing doesn't fail on trailing whitespace any more -.-

Helge Jung 9 роки тому
батько
коміт
ee8212c99c
1 змінених файлів з 4 додано та 4 видалено
  1. 4 4
      ffstatus/server.py

+ 4 - 4
ffstatus/server.py

@@ -492,16 +492,16 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
 					isp = desc_lines[0]
 
 					# normalize name: strip company indication
-					isp = re.sub(r'(AG|UG|G?mbH( ?& ?Co\.? ?(OH|K)G)?)$', '', isp, flags=re.IGNORECASE)
+					isp = re.sub(r'(AG|UG|G?mbH( ?& ?Co\.? ?(OH|K)G)?)\s*$', '', isp, flags=re.IGNORECASE)
 
 					# normalize name: strip "pool" suffixes
-					isp = re.sub(r'(dynamic )?(customer |subscriber )?(ip )?(pool|(address )?range|addresses)$', '', isp, flags=re.IGNORECASE)
+					isp = re.sub(r'(dynamic )?(customer |subscriber )?(ip )?(pool|(address )?range|addresses)$\s*', '', isp, flags=re.IGNORECASE)
 
 					# normalize name: strip "B2B" and aggregation suffixes
-					isp = re.sub(r'(B2B )?(aggregate|aggregation)?$', '', isp, flags=re.IGNORECASE)
+					isp = re.sub(r'(B2B )?(aggregate|aggregation)?$\s*', '', isp, flags=re.IGNORECASE)
 
 					# normalize name: strip country suffixes (in Germany)
-					isp = re.sub(r'(DE|Deutschland|Germany|Nordrhein[- ]Westfalen|NRW|Baden[- ]Wuerttemburg|BW|Hessen|Niedersachsen|Rheinland[- ]Pfalz|RLP)$', '', isp, flags=re.IGNORECASE)
+					isp = re.sub(r'(DE|Deutschland|Germany|Nordrhein[- ]Westfalen|NRW|Baden[- ]Wuerttemburg|BW|Hessen|Niedersachsen|Rheinland[- ]Pfalz|RLP)$\s*', '', isp, flags=re.IGNORECASE)
 
 				item_isps.add(isp)