diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/html.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/utils/html.c b/src/utils/html.c index ac4ae9f..20a1c96 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -725,11 +725,25 @@ mq_html_input_checkbox(const gchar *name, const gchar *label, gboolean checked) * <input> when the former <input> is checked. */ - return g_strdup_printf("<label for=\"%s\">\n<span>%s:</span>\n" - "<input type=\"hidden\" name=\"%s\" value=\"off\">\n" - "<input type=\"checkbox\" name=\"%s\" id=\"%s\"%s>\n</label>\n", - name, label, name, name, name, - checked ? " checked=\"checked\"" : ""); + if (label && label[0]) { + return g_strdup_printf( + "<label for=\"%s\">\n<span>%s:</span>\n" + "<input type=\"hidden\" name=\"%s\" " + "value=\"off\">\n" + "<input type=\"checkbox\" name=\"%s\" " + "id=\"%s\"%s>\n" + "</label>\n", + name, label, name, name, name, + checked ? " checked=\"checked\"" : ""); + } else { + return g_strdup_printf( + "<input type=\"hidden\" name=\"%s\" " + "value=\"off\">\n" + "<input type=\"checkbox\" name=\"%s\" " + "id=\"%s\"%s>\n", + name, name, name, + checked ? " checked=\"checked\"" : ""); + } } gchar * |