22 lines
417 B
Python
22 lines
417 B
Python
import re
|
|
|
|
with open('index.php', 'r') as f:
|
|
content = f.read()
|
|
|
|
patch_code = """
|
|
instanceModalElement.addEventListener('hidden.bs.modal', function () {
|
|
if (window.matrixNeedsRefresh) {
|
|
window.location.reload();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
"""
|
|
|
|
content = content.replace("});\n</script>", patch_code)
|
|
|
|
with open('index.php', 'w') as f:
|
|
f.write(content)
|
|
|
|
print("Patched index.php")
|