mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-25 07:35:57 +01:00
sanitize input to the picker
This commit is contained in:
parent
13db7db849
commit
f8cdd28cc8
1 changed files with 6 additions and 0 deletions
|
@ -40,6 +40,9 @@ void handleTitle(void *data, struct zwlr_foreign_toplevel_handle_v1 *handle, con
|
||||||
wl_list_for_each(current, &ctx->toplevel_resource_list, link) {
|
wl_list_for_each(current, &ctx->toplevel_resource_list, link) {
|
||||||
if (current->handle == handle) {
|
if (current->handle == handle) {
|
||||||
strncpy(current->name, title, 255);
|
strncpy(current->name, title, 255);
|
||||||
|
for (int i = 0; i < 255; ++i)
|
||||||
|
if (current->name[i] == '\"' || current->name[i] == '\011' || current->name[i] == '\'')
|
||||||
|
current->name[i] = ' ';
|
||||||
current->name[255] = '\0';
|
current->name[255] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -53,6 +56,9 @@ void handleAppID(void *data, struct zwlr_foreign_toplevel_handle_v1 *handle, con
|
||||||
wl_list_for_each(current, &ctx->toplevel_resource_list, link) {
|
wl_list_for_each(current, &ctx->toplevel_resource_list, link) {
|
||||||
if (current->handle == handle) {
|
if (current->handle == handle) {
|
||||||
strncpy(current->clazz, app_id, 255);
|
strncpy(current->clazz, app_id, 255);
|
||||||
|
for (int i = 0; i < 255; ++i)
|
||||||
|
if (current->clazz[i] == '\"' || current->clazz[i] == '\011' || current->clazz[i] == '\'')
|
||||||
|
current->clazz[i] = ' ';
|
||||||
current->name[255] = '\0';
|
current->name[255] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue