Fix fragment-util for validating if mandatory tags(dc:title, dc:class) are not...

Fix fragment-util for validating if mandatory tags(dc:title, dc:class) are not being set to empty literal while performing UpdateObject action
parent 1a991fe4
......@@ -710,6 +710,25 @@ fragment_util_check_fragments (DocNode *original,
goto out;
}
// If the child element is title or class it must not be set to empty or removed.
if (current_doc->children->children != NULL) {
if (g_strrstr(current_doc->children->children->name,"title") != NULL
|| g_strrstr(current_doc->children->children->name,"class") != NULL){
// If the new tag has no corresponding title or class element
if (new_doc->children->children == NULL) {
result = GUPNP_DIDL_LITE_FRAGMENT_RESULT_REQUIRED_TAG;
goto out;
}
// If the new tag has an empty value for title or class
if (new_doc->children->children->children == NULL) {
result = GUPNP_DIDL_LITE_FRAGMENT_RESULT_REQUIRED_TAG;
goto out;
}
}
}
if (!is_current_doc_part_of_original_doc (original, current_doc)) {
result = GUPNP_DIDL_LITE_FRAGMENT_RESULT_CURRENT_INVALID;
......
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