mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
gdbus: Use g_markup_collect_known_attributes() in GDBus introspection
In order to be able to cope with the introspection XML from the Telepathy specification, which uses attributes like tp:type and tp:name-for-bindings, we need to ignore unknown attributes when parsing. Closes: https://bugzilla.gnome.org/show_bug.cgi?id=665634
This commit is contained in:
parent
8d40389d15
commit
86329ba44f
@ -1276,13 +1276,11 @@ parser_start_element (GMarkupParseContext *context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_markup_collect_attributes (element_name,
|
if (!g_markup_collect_known_attributes (element_name,
|
||||||
attribute_names,
|
attribute_names,
|
||||||
attribute_values,
|
attribute_values,
|
||||||
error,
|
error,
|
||||||
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "name", &name,
|
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "name", &name,
|
||||||
/* some hand-written introspection XML documents use this */
|
|
||||||
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "xmlns:doc", NULL,
|
|
||||||
G_MARKUP_COLLECT_INVALID))
|
G_MARKUP_COLLECT_INVALID))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -1315,13 +1313,11 @@ parser_start_element (GMarkupParseContext *context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_markup_collect_attributes (element_name,
|
if (!g_markup_collect_known_attributes (element_name,
|
||||||
attribute_names,
|
attribute_names,
|
||||||
attribute_values,
|
attribute_values,
|
||||||
error,
|
error,
|
||||||
G_MARKUP_COLLECT_STRING, "name", &name,
|
G_MARKUP_COLLECT_STRING, "name", &name,
|
||||||
/* seen in the wild */
|
|
||||||
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "version", NULL,
|
|
||||||
G_MARKUP_COLLECT_INVALID))
|
G_MARKUP_COLLECT_INVALID))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -1346,13 +1342,11 @@ parser_start_element (GMarkupParseContext *context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_markup_collect_attributes (element_name,
|
if (!g_markup_collect_known_attributes (element_name,
|
||||||
attribute_names,
|
attribute_names,
|
||||||
attribute_values,
|
attribute_values,
|
||||||
error,
|
error,
|
||||||
G_MARKUP_COLLECT_STRING, "name", &name,
|
G_MARKUP_COLLECT_STRING, "name", &name,
|
||||||
/* seen in the wild */
|
|
||||||
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "version", NULL,
|
|
||||||
G_MARKUP_COLLECT_INVALID))
|
G_MARKUP_COLLECT_INVALID))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -1378,7 +1372,7 @@ parser_start_element (GMarkupParseContext *context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_markup_collect_attributes (element_name,
|
if (!g_markup_collect_known_attributes (element_name,
|
||||||
attribute_names,
|
attribute_names,
|
||||||
attribute_values,
|
attribute_values,
|
||||||
error,
|
error,
|
||||||
@ -1409,7 +1403,7 @@ parser_start_element (GMarkupParseContext *context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_markup_collect_attributes (element_name,
|
if (!g_markup_collect_known_attributes (element_name,
|
||||||
attribute_names,
|
attribute_names,
|
||||||
attribute_values,
|
attribute_values,
|
||||||
error,
|
error,
|
||||||
@ -1460,7 +1454,7 @@ parser_start_element (GMarkupParseContext *context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_markup_collect_attributes (element_name,
|
if (!g_markup_collect_known_attributes (element_name,
|
||||||
attribute_names,
|
attribute_names,
|
||||||
attribute_values,
|
attribute_values,
|
||||||
error,
|
error,
|
||||||
@ -1547,7 +1541,7 @@ parser_start_element (GMarkupParseContext *context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_markup_collect_attributes (element_name,
|
if (!g_markup_collect_known_attributes (element_name,
|
||||||
attribute_names,
|
attribute_names,
|
||||||
attribute_values,
|
attribute_values,
|
||||||
error,
|
error,
|
||||||
|
Loading…
Reference in New Issue
Block a user