Skip to content

Commit

Permalink
[frequencyfinder.py] avoid unencoded ampersands in network_name, atte…
Browse files Browse the repository at this point in the history
…mpt 2
  • Loading branch information
Huevos committed Oct 31, 2019
1 parent ae891ab commit 62d2447
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AutoBouquetsMaker/src/scanner/frequencyfinder.py
Expand Up @@ -502,7 +502,7 @@ def readNIT(self):
nit_current_content += section["content"]

if 'network_name' in section["header"] and section["header"]["network_name"] != "Unknown":
self.network_name = section["header"]["network_name"]
self.network_name = re.sub(r'&(?![A-Za-z]+[0-9]*;|#[0-9]+;|#x[0-9a-fA-F]+;)', r'&', section["header"]["network_name"]) # regex to avoid unencoded ampersands that are not entities

if len(nit_current_sections_read) == nit_current_sections_count:
nit_current_completed = True
Expand Down Expand Up @@ -561,7 +561,7 @@ def saveProviderFile(self):
break
network_name = self.strongestTransponder["network_name"]
customProviderList.append('<provider>\n')
customProviderList.append('\t<name>%s terrestrial</name>\n' % re.sub(r'&(?![A-Za-z]+[0-9]*;|#[0-9]+;|#x[0-9a-fA-F]+;)', r'&amp;', network_name)) # regex to avoid unencoded ampersands that are not entities
customProviderList.append('\t<name>%s terrestrial</name>\n' % network_name)
customProviderList.append('\t<streamtype>dvbt</streamtype>\n')
customProviderList.append('\t<protocol>lcn</protocol>\n')
customProviderList.append('\t<dvbtconfigs>\n')
Expand Down

4 comments on commit 62d2447

@ccs-ccs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fat-tony spotted a typo at line 213

message = 'New provider created named "%s terrestrial".\nEnable this provider, disable the existing DVB-T provider and then and start a scan.' % self.strongestTransponder["network_name"]

.... and then and start a scan.

@Huevos
Copy link
Member Author

@Huevos Huevos commented on 62d2447 Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit doesn't have a line 213.

@ccs-ccs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but the source file does.

@Huevos
Copy link
Member Author

@Huevos Huevos commented on 62d2447 Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to send a PR.

Please sign in to comment.