Add pre-upload check for case conflicts

This commit is contained in:
Alexander van Gessel 2017-10-17 18:23:54 +02:00
parent 619ada437a
commit 927fcb2084

View file

@ -152,6 +152,13 @@ bool addons_client::upload_addon(const std::string& id, std::string& response_me
this->last_error_data_ = utils::join(badnames, "\n");
return false;
}
if(!check_case_insensitive_duplicates(addon_data, &badnames)){
this->last_error_ =
vgettext("The add-on <i>$addon_title</i> contains files or directories with case conflicts. "
"File or directory names may not be differently-cased versions of the same string.", i18n_symbols);
this->last_error_data_ = utils::join(badnames, "\n");
return false;
}
config request_buf, response_buf;
request_buf.add_child("upload", cfg).add_child("data", addon_data);