Fix escaping
All checks were successful
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Successful in 41s
All checks were successful
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Successful in 41s
This commit is contained in:
@@ -14,6 +14,7 @@ import time
|
|||||||
import webbrowser
|
import webbrowser
|
||||||
from update_checker import UpdateChecker
|
from update_checker import UpdateChecker
|
||||||
from update_config import get_update_config
|
from update_config import get_update_config
|
||||||
|
import html
|
||||||
|
|
||||||
# Load environment variables
|
# Load environment variables
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
@@ -2009,6 +2010,14 @@ class SteamWorkshopGUI:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._safe_update_output(f"Error creating Homebrew RML file: {str(e)}\n")
|
self._safe_update_output(f"Error creating Homebrew RML file: {str(e)}\n")
|
||||||
|
|
||||||
|
def escape_xml_text(self, text):
|
||||||
|
"""Escape special XML characters in text content"""
|
||||||
|
if not text:
|
||||||
|
return text
|
||||||
|
# Use html.escape to handle XML/HTML entities properly
|
||||||
|
# xml_char_ref=False ensures we get named entities like & instead of numeric ones
|
||||||
|
return html.escape(text, quote=False)
|
||||||
|
|
||||||
def generate_homebrew_rml_xml(self, current_mods, workshop_results):
|
def generate_homebrew_rml_xml(self, current_mods, workshop_results):
|
||||||
"""Generate the XML content for the homebrew .rml file"""
|
"""Generate the XML content for the homebrew .rml file"""
|
||||||
xml_lines = [
|
xml_lines = [
|
||||||
@@ -2050,12 +2059,14 @@ class SteamWorkshopGUI:
|
|||||||
|
|
||||||
# Add current mod names first
|
# Add current mod names first
|
||||||
for package_id, mod_name in current_mods:
|
for package_id, mod_name in current_mods:
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
# Add workshop mod names to meta section
|
# Add workshop mod names to meta section
|
||||||
for workshop_id, package_id in workshop_results:
|
for workshop_id, package_id in workshop_results:
|
||||||
mod_name = self.get_mod_name_from_about_xml(workshop_id)
|
mod_name = self.get_mod_name_from_about_xml(workshop_id)
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
xml_lines.extend([
|
xml_lines.extend([
|
||||||
'\t\t</modNames>',
|
'\t\t</modNames>',
|
||||||
@@ -2079,12 +2090,14 @@ class SteamWorkshopGUI:
|
|||||||
|
|
||||||
# Add current mod names first to modList section
|
# Add current mod names first to modList section
|
||||||
for package_id, mod_name in current_mods:
|
for package_id, mod_name in current_mods:
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
# Add workshop mod names to modList section
|
# Add workshop mod names to modList section
|
||||||
for workshop_id, package_id in workshop_results:
|
for workshop_id, package_id in workshop_results:
|
||||||
mod_name = self.get_mod_name_from_about_xml(workshop_id)
|
mod_name = self.get_mod_name_from_about_xml(workshop_id)
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
xml_lines.extend([
|
xml_lines.extend([
|
||||||
'\t\t</names>',
|
'\t\t</names>',
|
||||||
@@ -2179,11 +2192,13 @@ class SteamWorkshopGUI:
|
|||||||
|
|
||||||
# Add core mod names first
|
# Add core mod names first
|
||||||
for package_id, mod_name in core_mods:
|
for package_id, mod_name in core_mods:
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
# Add workshop mod names to meta section
|
# Add workshop mod names to meta section
|
||||||
for mod_name in mod_names:
|
for mod_name in mod_names:
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
xml_lines.extend([
|
xml_lines.extend([
|
||||||
'\t\t</modNames>',
|
'\t\t</modNames>',
|
||||||
@@ -2207,11 +2222,13 @@ class SteamWorkshopGUI:
|
|||||||
|
|
||||||
# Add core mod names first to modList section
|
# Add core mod names first to modList section
|
||||||
for package_id, mod_name in core_mods:
|
for package_id, mod_name in core_mods:
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
# Add workshop mod names to modList section
|
# Add workshop mod names to modList section
|
||||||
for mod_name in mod_names:
|
for mod_name in mod_names:
|
||||||
xml_lines.append(f'\t\t\t<li>{mod_name}</li>')
|
escaped_name = self.escape_xml_text(mod_name)
|
||||||
|
xml_lines.append(f'\t\t\t<li>{escaped_name}</li>')
|
||||||
|
|
||||||
xml_lines.extend([
|
xml_lines.extend([
|
||||||
'\t\t</names>',
|
'\t\t</names>',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Configuration settings for the update checker
|
|||||||
# Update checker configuration
|
# Update checker configuration
|
||||||
UPDATE_CONFIG = {
|
UPDATE_CONFIG = {
|
||||||
# Current version of the application
|
# Current version of the application
|
||||||
"current_version": "0.0.3",
|
"current_version": "0.0.4",
|
||||||
|
|
||||||
# Repository information
|
# Repository information
|
||||||
"repo_owner": "HRiggs",
|
"repo_owner": "HRiggs",
|
||||||
|
|||||||
Reference in New Issue
Block a user