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;
|
vector<string> tags_string;
|
||||||
|
|
||||||
cgi.getElement("tags[]", tags_form);
|
cgi.getElement("tags[]", tags_form);
|
||||||
transform(tags_form.begin(), tags_form.end(), back_inserter(tags_string),
|
for (const auto &element : tags_form)
|
||||||
[](const auto &element) { return tolower(element.getValue()); });
|
{
|
||||||
|
const string_view tag{element.getValue()};
|
||||||
|
if (!tag.empty())
|
||||||
|
{
|
||||||
|
tags_string.push_back(tolower(tag));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return tags_string;
|
return tags_string;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue