Commit 15c0573d authored by skummer's avatar skummer

ZP-481 #comment read supported contents only if there is content, else ignore supported completely

git-svn-id: https://z-push.org/svn/z-push/trunk@1790 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 0144b970
......@@ -175,17 +175,22 @@ class Sync extends RequestProcessor {
ZLog::Write(LOGLEVEL_WARN, "Not possible to determine class of request. Request did not contain class and apparently there is an issue with the HierarchyCache.");
// SUPPORTED properties
if(self::$decoder->getElementStartTag(SYNC_SUPPORTED)) {
$supfields = array();
while(1) {
$el = self::$decoder->getElement();
if(($se = self::$decoder->getElementStartTag(SYNC_SUPPORTED)) !== false) {
// ZP-481: LG phones send an empty supported tag, so only read the contents if available here
// if <Supported/> is received, it's as no supported fields would have been sent at all.
// unsure if this is the correct approach, or if in this case some default list should be used
if ($se[EN_FLAGS] & EN_FLAGS_CONTENT) {
$supfields = array();
while(1) {
$el = self::$decoder->getElement();
if($el[EN_TYPE] == EN_TYPE_ENDTAG)
break;
else
$supfields[] = $el[EN_TAG];
if($el[EN_TYPE] == EN_TYPE_ENDTAG)
break;
else
$supfields[] = $el[EN_TAG];
}
self::$deviceManager->SetSupportedFields($spa->GetFolderId(), $supfields);
}
self::$deviceManager->SetSupportedFields($spa->GetFolderId(), $supfields);
}
// Deletes as moves can be an empty tag as well as have value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment