Files
weval-l99/fix_wtp_v71_r1.py
2026-04-20 04:10:40 +02:00

27 lines
984 B
Python

#!/usr/bin/env python3
path = "/var/www/html/weval-technology-platform.html"
with open(path, "rb") as f:
raw = f.read()
# Fix 1: sidebar item - replace escaped quotes with normal
bad_sidebar = b"{id:\\'crm_bridge\\', icon:\\'\\', label:\\'CRM Bridge (4 CRMs)\\', color:\\'#22d3ee\\', count: 4},"
good_sidebar = b"{id:'crm_bridge', icon:'\xf0\x9f\x94\x97', label:'CRM Bridge (4 CRMs)', color:'#22d3ee', count: 4},"
if bad_sidebar not in raw:
print("BAD_NOT_FOUND - investigating")
idx = raw.find(b"crm_bridge")
print(f"ctx: {raw[idx-10:idx+150]!r}")
exit(1)
new_raw = raw.replace(bad_sidebar, good_sidebar, 1)
# Drawer already had normal quotes (it was in HTML attributes, worked)
# But verify
print(f"Fixed {len(raw)} -> {len(new_raw)}")
# Check count
print(f"crm_bridge now: {new_raw.count(b'crm_bridge')}")
print(f"escaped quotes check: {new_raw.count(chr(92).encode() + chr(39).encode() + b'crm_bridge')}")
with open(path, "wb") as f:
f.write(new_raw)