diff --git a/index.php b/index.php index 1504512..7e3f2f9 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,7 @@ function missingConfig($missingParam){ } // global variables -$output = $usePort = $useEncryption = $recipient = $replyTo = NULL; +$output = $usePort = $useArbPort = $useEncryption = $recipient = $replyTo = NULL; // check configuration for missing entries if (!$SMTP['timeout']) $SMTP['timeout'] = 15; @@ -25,7 +25,13 @@ if (!$SMTP['password']) missingConfig('password'); // process POST request if made if (isset($_POST) && !empty($_POST)){ // retain settings - if (!empty($_POST['port'])){ + if (!empty($_POST['portArbitrary'])){ + if (filter_var($_POST['portArbitrary'], FILTER_VALIDATE_INT)){ + $usePort = $useArbPort = $_POST['portArbitrary']; + } else{ + $output .= '<< invalid port specified >>
'; + } + } elseif (!empty($_POST['port'])){ $usePort = $_POST['port']; } else{ $output .= '<< no port selected >>
'; @@ -36,12 +42,20 @@ if (isset($_POST) && !empty($_POST)){ $output .= '<< no encryption selected >>
'; } if (!empty($_POST['recipient'])){ - $recipient = filter_var($_POST['recipient'], FILTER_VALIDATE_EMAIL) ? $_POST['recipient'] : $output .= '<< no recipient address specified >>
'; + if (filter_var($_POST['recipient'], FILTER_VALIDATE_EMAIL)){ + $recipient = $_POST['recipient']; + } else{ + $output .= '<< no recipient address specified >>
'; + } } else{ $output .= '<< no recipient address specified >>
'; } if (!empty($_POST['replyTo'])){ - $replyTo = filter_var($_POST['replyTo'], FILTER_VALIDATE_EMAIL) ? $_POST['replyTo'] : $output .= '<< no reply address specified >>
'; + if (filter_var($_POST['replyTo'], FILTER_VALIDATE_EMAIL)){ + $replyTo = $_POST['replyTo']; + } else{ + $output .= '<< no reply address specified >>
'; + } } else{ $output .= '<< no reply address specified >>
'; } @@ -87,7 +101,11 @@ if (isset($_POST) && !empty($_POST)){ +