mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-22 14:12:25 +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'];
|
$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();
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user