From 4c277884e0f122bc68572d75c2ac3201d3f54d23 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Wed, 14 Jun 2006 05:37:53 +0000 Subject: [PATCH] fix for incomplete targetURI Patch from Franky(liedekef) --- phpgwapi/inc/horde/Horde/SyncML.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/horde/Horde/SyncML.php b/phpgwapi/inc/horde/Horde/SyncML.php index 3a0b740850..db5c75dad0 100644 --- a/phpgwapi/inc/horde/Horde/SyncML.php +++ b/phpgwapi/inc/horde/Horde/SyncML.php @@ -351,10 +351,16 @@ class Horde_SyncML_SyncMLHdr extends Horde_SyncML_ContentHandler { $output->characters($this->_targetURI); $output->endElement($uri, 'LocURI'); $output->endElement($uri, 'Source'); - + if(session_id() != '' && !strpos($this->_targetURI,'syncml_sessionid')) { $output->startElement($uri, 'RespURI', $attrs); - $output->characters($this->_targetURI . '?syncml_sessionid=' . session_id()); + + // some clients don't send the whole URL as targetURI + if (strpos($this->_targetURI,$_SERVER['PHP_SELF']) === false) { + $output->characters($this->_targetURI . $_SERVER['PHP_SELF'] . '?syncml_sessionid=' . session_id()); + } else { + $output->characters($this->_targetURI . '?syncml_sessionid=' . session_id()); + } $output->endElement($uri, 'RespURI'); }