DVL-013 Fix error handling in logger

This commit is contained in:
cytopia 2017-11-04 13:42:41 +01:00
parent aaaab931b7
commit e254d01a65
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ if (isset($_GET['email']) && isset($_GET['subject']) && isset($_GET['message']))
$subj = $_GET['subject']; $subj = $_GET['subject'];
$mess = $_GET['message']; $mess = $_GET['message'];
if (! mail($mail, $subj, $mess)) { if (! mail($mail, $subj, $mess)) {
loadClass('Logger')->error('Could not send mail to: '.$mail.' | subject: '.$subject); loadClass('Logger')->error('Could not send mail to: '.$mail.' | subject: '.$subj);
} }
header('Location: /mail.php'); header('Location: /mail.php');
exit(); exit();

View File

@ -123,8 +123,8 @@ class Helper
// New request, generic check // New request, generic check
// Note the traiing dot to prevent recursive lookups // Note the traiing dot to prevent recursive lookups
$ip = $this->exec('ping -c 1 '.$hostname.'. 2>/dev/null | grep -Eo \'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\' | head -1'); //$ip = $this->exec('ping -c 1 '.$hostname.'. 2>/dev/null | grep -Eo \'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\' | head -1');
//$ip = gethostbyname($hostname.''); $ip = gethostbyname($hostname.'');
if (filter_var($ip, FILTER_VALIDATE_IP) === false) { if (filter_var($ip, FILTER_VALIDATE_IP) === false) {
//loadClass('Logger')->error('Retrieving the IP address of host \''.$hostname.'\' failed: '.$ip); //loadClass('Logger')->error('Retrieving the IP address of host \''.$hostname.'\' failed: '.$ip);