Adding artist/release/track max name length checks. NOT TESTED

This commit is contained in:
emeric
2014-08-20 14:32:22 +02:00
parent 62d2f6af2a
commit 2f376fbc7a
5 changed files with 20 additions and 14 deletions
+2 -2
View File
@@ -7,14 +7,14 @@
namespace Database {
Release::Release(const std::string& name)
: _name(name)
: _name(std::string(name, 0, _maxNameLength))
{
}
Release::pointer
Release::getByName(Wt::Dbo::Session& session, const std::string& name)
{
return session.find<Release>().where("name = ?").bind( name );
return session.find<Release>().where("name = ?").bind( std::string(name, 0, _maxNameLength) );
}
Release::pointer