Perl – Regular Expressions – $value =~ s/~!/ ~!/g;?

This line is from the classic formmail.cgi script:
$value =~ s/~!/ ~!/g;

It’s to stop people from using subshells. But, does anyone know what this line is actually doing and how it’s doing it?

Thanks.

Comments

  1. martinthurn says:

    In the Unix email reader program mailx, when you type ~! at the front of a line, it opens a subshell. Using this regex, formmail.cgi is inserting a space in front of every occurrence of tilde-bang, so that it never looks like it’s at the front of a line (and therefore mailx will never open a subshell, which would be one way for someone to hack into your computer).

legitimate work from home jobs | Event Planning Bay Area | rent video games | Homeloans | Plumbing Courses in Manchester | increase fertility | Green Drink | Photo Keyring | Vitamin D Deficiency Symptoms | skip bags | Order Fulfillment Software | virtual receptionist | Educators Credit | bodybuilding workouts | window cleaning
Poker Software