Added blocking of names ending in .

This commit is contained in:
cocopaw 2025-08-07 19:36:44 +10:00
commit 365e1e6f56

View file

@ -302,9 +302,10 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu
{
const QString currentName = item->name();
QString newName = value.toString().trimmed();
if (currentName != newName)
{
bool invalid = newName.isEmpty() || (newName == u"."_s) || (newName == u".."_s) || (newName.length() > 255);
bool invalid = newName.isEmpty() || (newName == u"."_s) || (newName == u".."_s) || (newName.length() > 255) || newName.endsWith(u'.');
if (!invalid)
{
for (const QChar &c : newName)