Permalink
Browse files

added regular expression to test if the email address supplied is wel…

…l formed. if so, use supplied email address in the 'from' header, else use generic support email address

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information...
1 parent 8822111 commit b6b1ab1e629a7be218b805f09bcba177ff6b3407 Clint Shryock committed with Jul 16, 2009
Showing with 6 additions and 5 deletions.
  1. +6 −5 jrfeedback.php
View
@@ -19,12 +19,13 @@
// suppressed@auma.pair.com or anonymous@auma.pair.com
// FogBugz would try to send them an email and generate another
// ticket telling me "Undelivered Mail Returned to Sender"
- // TODO: It'd be nice to make sure the string looks like a
- // real email address but I'll assume everyone is playing nice.
- if ($_REQUEST['email'] == '') {
- $email = 'YOUR_EMAIL_ADDRESS_HERE@gmail.com';
- } else {
+
+ // Check for well formatted email address, if it's OK use their address in the "from" header, else
+ // use generic support address
+ if (eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$', $_REQUEST['email'])) {
$email = $_REQUEST['email'];
+ } else {
+ $email = 'YOUR_EMAIL_ADDRESS_HERE@gmail.com';
}
$feedback = $_REQUEST['feedback'];
$bundleID = $_REQUEST['bundleID'];

0 comments on commit b6b1ab1

Please sign in to comment.