diff --git a/php/cl_contactform_output.php b/php/cl_contactform_output.php index 5560765..1db229c 100644 --- a/php/cl_contactform_output.php +++ b/php/cl_contactform_output.php @@ -1,6 +1,4 @@ unravel($this->suppress('sent')); $this->generateEmailMessage(); - $phpMailer = new PHPMailer(true); + $phpMailer = new \PHPMailer\PHPMailer\PHPMailer(true); $phpMailer->isMail(); $phpMailer->isHTML(false); $phpMailer->CharSet = "UTF-8"; @@ -53,7 +51,7 @@ class w3form if ($phpMailer->send()) { return true; } - } catch (Exception $e) { + } catch (\PHPMailer\PHPMailer\Exception $e) { echo $e->errorMessage(); } return false; @@ -178,11 +176,7 @@ class w3form $style = ''; $value = ''; - if (!empty($attribute['id'])) { - $parameter = 'id="' . $attribute['id'] . '"'; - } else { - $parameter = 'id="' . $attribute['name'] . '"'; - } + $parameter = empty($attribute['id']) ? 'id="' . $attribute['name'] . '"' : 'id="' . $attribute['id'] . '"'; $parameter .= ' name="' . $attribute['name'] . '"';