Un minimun de gestion d'erreurs

This commit is contained in:
Alan Garcia 2013-07-22 16:51:23 +00:00
parent 944d861a16
commit 9866a5a74a
2 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,8 @@ if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
$pattern = '/[A-Za-z0-9_-]+@[A-Za-z0-9_-]+.([A-Za-z0-9_-][A-Za-z0-9_]+)/';
preg_match($pattern, $string, $matches);
$emailDomain = explode('@', $matches[0]);
} else {
die(_('Missing POST of the mail address'));
}
header("Content-type: text/xml");

View File

@ -2,11 +2,15 @@
require_once("../class/config_nochk.php");
header ("Content-Type:text/xml");
if (empty($_GET['emailaddress'])) die(_("Error: Missing GET of emailaddress"));
$emailDomain = explode('@', rawurldecode($_GET['emailaddress']));
if (empty($emailDomain)) die(_('Error: Empty $emailDomain'));
?>
<clientConfig version="1.1">
<emailProvider id="<?php echo $L_FQDN ?>">
<domain><?php echo $emailDomain;?></domain>
<domain><?php echo $emailDomain[1];?></domain>
<displayName><?php echo $L_FQDN ?></displayName>
<displayShortName><?php echo $L_FQDN ?></displayShortName>
<incomingServer type="imap">