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,7 +7,7 @@ Genre::Genre()
}
Genre::Genre(const std::string& name)
: _name( name )
: _name( std::string(name, 0, _maxNameLength) )
{
}
@@ -16,7 +16,7 @@ Genre::pointer
Genre::getByName(Wt::Dbo::Session& session, const std::string& name)
{
// TODO use like search
return session.find<Genre>().where("name = ?").bind( name );
return session.find<Genre>().where("name = ?").bind( std::string(name, 0, _maxNameLength) );
}
Genre::pointer