diff options
author | Richard Hughes <richard@hughsie.com> | 2016-08-05 10:20:31 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-08-05 10:20:31 +0100 |
commit | e060e8c4b5c0a568f17386a4d401d384abf48633 (patch) | |
tree | 9e629c570699c251cfefdcb1f3da390547a1fede /libappstream-glib/as-app-validate.c | |
parent | 86a164816e56b4fe9fe87ae52a332394a3f8c7de (diff) | |
download | appstream-glib-e060e8c4b5c0a568f17386a4d401d384abf48633.tar.gz |
Add some more validation checks for keywords
Diffstat (limited to 'libappstream-glib/as-app-validate.c')
-rw-r--r-- | libappstream-glib/as-app-validate.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c index 57da467..9c421be 100644 --- a/libappstream-glib/as-app-validate.c +++ b/libappstream-glib/as-app-validate.c @@ -1297,6 +1297,20 @@ as_app_validate (AsApp *app, AsAppValidateFlags flags, GError **error) "XML data contains unknown tag"); } + /* only allow XML in the specification */ + if (problems & AS_APP_PROBLEM_EXPECTED_CHILDREN) { + ai_app_validate_add (&helper, + AS_PROBLEM_KIND_TAG_INVALID, + "Expected children for tag"); + } + + /* only allow XML in the specification */ + if (problems & AS_APP_PROBLEM_INVALID_KEYWORDS) { + ai_app_validate_add (&helper, + AS_PROBLEM_KIND_TAG_INVALID, + "<keyword> invalid contents"); + } + /* check for things that have to exist */ if (as_app_get_id (app) == NULL) { ai_app_validate_add (&helper, |