Don't add empty tags in get_tags().
This commit is contained in:
parent
f1d2c09c0b
commit
395b8efef2
10
src/cgi.cpp
10
src/cgi.cpp
|
@ -110,8 +110,14 @@ vector<string> get_tags()
|
|||
vector<string> tags_string;
|
||||
|
||||
cgi.getElement("tags[]", tags_form);
|
||||
transform(tags_form.begin(), tags_form.end(), back_inserter(tags_string),
|
||||
[](const auto &element) { return tolower(element.getValue()); });
|
||||
for (const auto &element : tags_form)
|
||||
{
|
||||
const string_view tag{element.getValue()};
|
||||
if (!tag.empty())
|
||||
{
|
||||
tags_string.push_back(tolower(tag));
|
||||
}
|
||||
}
|
||||
|
||||
return tags_string;
|
||||
}
|
||||
|
|
Reference in New Issue