mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-21 21:57:47 +00:00
DVL-013 Fix error handling in logger
This commit is contained in:
parent
aaaab931b7
commit
e254d01a65
@ -10,7 +10,7 @@ if (isset($_GET['email']) && isset($_GET['subject']) && isset($_GET['message']))
|
||||
$subj = $_GET['subject'];
|
||||
$mess = $_GET['message'];
|
||||
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');
|
||||
exit();
|
||||
|
@ -123,8 +123,8 @@ class Helper
|
||||
|
||||
// New request, generic check
|
||||
// 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 = gethostbyname($hostname.'');
|
||||
//$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.'');
|
||||
|
||||
if (filter_var($ip, FILTER_VALIDATE_IP) === false) {
|
||||
//loadClass('Logger')->error('Retrieving the IP address of host \''.$hostname.'\' failed: '.$ip);
|
||||
|
Loading…
Reference in New Issue
Block a user