From e45d15bc1f127118883eb08b8bec6259c7a75798 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Fri, 18 Jul 2014 20:15:59 +0300 Subject: [PATCH] Allow more characters in property/channel names This way properties can include things like a . in the name such as with Bug 11021. This may also be useful if we make xfconf a gsettings backend in the future. --- xfconfd/xfconf-backend.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xfconfd/xfconf-backend.c b/xfconfd/xfconf-backend.c index 6cb3adb..3be446a 100644 --- a/xfconfd/xfconf-backend.c +++ b/xfconfd/xfconf-backend.c @@ -117,13 +117,14 @@ xfconf_property_is_valid(const gchar *property, while(*p) { if(!(*p >= 'A' && *p <= 'Z') && !(*p >= 'a' && *p <= 'z') && !(*p >= '0' && *p <= '9') - && *p != '_' && *p != '-' && *p != '/' - && !(*p == '<' || *p == '>')) + && *p != '_' && *p != '-' && *p != '/' && *p != '{' && *p != '}' + && !(*p == '<' || *p == '>') && *p != '|' && *p != ',' + && *p != '[' && *p != ']' && *p != '.' && *p != ':') { if(error) { g_set_error(error, XFCONF_ERROR, XFCONF_ERROR_INVALID_PROPERTY, - _("Property names can only include the ASCII characters A-Z, a-z, 0-9, '_', '-', '<' and '>', as well as '/' as a separator")); + _("Property names can only include the ASCII characters A-Z, a-z, 0-9, '_', '-', ':', '.', ',', '[', ']', '{', '}', '<' and '>', as well as '/' as a separator")); } return FALSE; } @@ -168,12 +169,14 @@ xfconf_channel_is_valid(const gchar *channel, while(*p) { if(!(*p >= 'A' && *p <= 'Z') && !(*p >= 'a' && *p <= 'z') && !(*p >= '0' && *p <= '9') - && *p != '_' && *p != '-') + && *p != '_' && *p != '-' && *p != '{' && *p != '}' + && *p != '|' && *p != ',' + && *p != '[' && *p != ']' && *p != '.' && *p != ':') { if(error) { g_set_error(error, XFCONF_ERROR, XFCONF_ERROR_INVALID_CHANNEL, - _("Channel names can only include the ASCII characters A-Z, a-z, 0-9, '_', and '-'")); + _("Channel names can only include the ASCII characters A-Z, a-z, 0-9, '{', '}', '|', ']', '[', ':', ',', '.', '_', and '-'")); } return FALSE; } -- 2.0.1