From 204d9c533d983cce1a75f12ef218a92b01961d46 Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Wed, 8 Dec 2010 23:55:54 +0100 Subject: [PATCH] surpress warning in mail setup when hostname can't be determined --- inc/mail.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/mail.php b/inc/mail.php index 604a0999a..e1f327cfe 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -44,7 +44,9 @@ function mail_setup(){ if(!empty($USERINFO['mail'])){ $replace['@MAIL@'] = $USERINFO['mail']; }else{ - $replace['@MAIL@'] = 'noreply@'.parse_url(DOKU_URL,PHP_URL_HOST); + $host = @parse_url(DOKU_URL,PHP_URL_HOST); + if(!$host) $host = 'example.com'; + $replace['@MAIL@'] = 'noreply@'.$host; } if(!empty($_SERVER['REMOTE_USER'])){ -- GitLab