The recent XML changes introduced a bug where
wimlib_set_image_property() rejected values of property_name containing
'/', '[', or ']', which are part of the "path" syntax.
xml_clone_tree(struct xml_node *orig);
bool
xml_clone_tree(struct xml_node *orig);
bool
-xml_legal_name(const tchar *name);
+xml_legal_path(const tchar *name);
bool
xml_legal_value(const tchar *value);
bool
xml_legal_value(const tchar *value);
if (!property_name || !*property_name)
return WIMLIB_ERR_INVALID_PARAM;
if (!property_name || !*property_name)
return WIMLIB_ERR_INVALID_PARAM;
- if (!xml_legal_name(property_name)) {
+ if (!xml_legal_path(property_name)) {
ERROR("Property name '%"TS"' is illegal in XML", property_name);
return WIMLIB_ERR_INVALID_PARAM;
}
ERROR("Property name '%"TS"' is illegal in XML", property_name);
return WIMLIB_ERR_INVALID_PARAM;
}
(c >= '0' && c <= '9') || c == '-' || c == '.';
}
(c >= '0' && c <= '9') || c == '-' || c == '.';
}
+/* Allow characters used in element "paths"; see do_xml_path_walk() */
+static inline bool
+is_path_char(tchar c)
+{
+ return c == '/' || c == '[' || c == ']';
+}
+
-xml_legal_name(const tchar *p)
+xml_legal_path(const tchar *p)
- if (!is_name_start_char(*p))
+ if (!is_name_start_char(*p) && !is_path_char(*p))
return false;
for (p = p + 1; *p; p++) {
return false;
for (p = p + 1; *p; p++) {
+ if (!is_name_char(*p) && !is_path_char(*p))
return false;
}
return true;
return false;
}
return true;