From 3f5f95a6333201a84e2f8a4cc1295f2288dbe0c6 Mon Sep 17 00:00:00 2001 From: jkaberg Date: Tue, 19 Aug 2014 11:31:54 +0200 Subject: [PATCH] fix preg_match and move up xml line --- tools/exchange-autodiscover.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/exchange-autodiscover.php b/tools/exchange-autodiscover.php index 77b0b966..07803762 100755 --- a/tools/exchange-autodiscover.php +++ b/tools/exchange-autodiscover.php @@ -11,15 +11,14 @@ // We might get two kinds of requests. $post_body = file_get_contents('php://input'); - preg_match('/(.*?)<\/AcceptableResponseSchema>/', $post_body, $match); + $match = preg_match('/(.*?)<\/AcceptableResponseSchema>/', $post_body, $match); $AcceptableResponseSchema = $match[1]; if ($AcceptableResponseSchema == "http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006") { // There is no way to convey the user's login name with this? ?> - + @@ -40,7 +39,7 @@ xmlns:autodiscover="http://schemas.microsoft.com/exchange/autodiscover/mobilesyn // Parse the email address out of the POST request, which // we pass back as the login name. - preg_match('/(.*?)<\/EMailAddress>/', $post_body, $match); + $match = preg_match('/(.*?)<\/EMailAddress>/', $post_body, $match); $LOGIN = $match[1]; header("Content-type: text/xml");