Advertisement
AppajiC

Untitled

May 30th, 2022
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import re
  2.  
  3.  
  4. def main():
  5.     with open("input.txt", "r") as f:
  6.         data = f.read()
  7.  
  8.     pattern = re.compile(r"\$(\w+)\s*=\s*Input::get\(\'\w+\'\);")
  9.     new_data = re.sub(pattern, r"$\1 = mysqli_real_escape_string($conn,$\1);", data)
  10.     with open("output.txt", "w") as f:
  11.         f.write(new_data)
  12.  
  13.  
  14. if __name__ == "__main__":
  15.     main()
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement