37338-vm/patch2.py
2026-03-02 07:38:53 +00:00

18 lines
563 B
Python

import re
with open('WorkflowEngine.php', 'r') as f:
content = f.read()
target = """ $stmt = $this->pdo->prepare("SELECT * FROM process_instances WHERE `person_id` = ? AND `process_definition_id` = ?");
$stmt->execute([$personId, $processDefinitionId]);
$instance = $stmt->fetch(PDO::FETCH_ASSOC);"""
replacement = """ $instance = $this->getInstanceByDefId($personId, $processDefinitionId);"""
content = content.replace(target, replacement)
with open('WorkflowEngine.php', 'w') as f:
f.write(content)
print("Patched.")