Paris Hilton just realized ... the guy who attacked her boyfriend at an L.A. courthouse this week PROPOSED to her at a So Cal media event back in February ... and it was all caught on tape.
Hilton just went to her Twitter page and wrote, "OMG! I just realized that the attacker from [the attack] video is same nut who proposed at [a Macy's event in February]."
The man -- James Rainford -- was arrested after smacking Cy Waits in the back of the head Wednesday as Cy was walking Paris into court.
Rainford -- who was already on probation -- plead no contest to misdemeanor battery and was sentenced to 227 days in jail.